Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save antonjn/3373994 to your computer and use it in GitHub Desktop.
Save antonjn/3373994 to your computer and use it in GitHub Desktop.
'no-break space' detection plugin for Sublime Text 2
# encoding: utf-8
import sublime, sublime_plugin
class DetectSpecialCharacters(sublime_plugin.EventListener):
def on_load(self, view):
sublime.status_message("detect_special_characters is active")
def on_modified(self, view):
# find no-break space
special_characters = view.find_all(u"\u00A0")
if len(special_characters) > 0:
sublime.error_message("ohhh noose! detected a NO-BREAK SPACE (U+00A0)")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment