G2A Many GEOs
SHARE
TWEET

SublimeText ShowZeroWidthSpace

FichteFoll Apr 3rd, 2013 2,548 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # http://sublimetext.userecho.com/topic/104394-is-it-possible-to-show-all-characters-spaces-tabs-cr-lf-etc/#comment_180170
  2. import sublime_plugin
  3.  
  4.  
  5. class ShowZeroWidthSpace(sublime_plugin.EventListener):
  6.     def on_modified(self, view):
  7.         spaces = []
  8.         p = 0
  9.         while 1:
  10.             s = view.find(u'\u200b', p + 1)
  11.             if not s:
  12.                 break
  13.             spaces.append(s)
  14.             p = s.a
  15.  
  16.         if spaces:
  17.             view.add_regions("zero-width", spaces, "string")
  18.         else:
  19.             view.erase_regions("zero-width")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top