Skip to content

Instantly share code, notes, and snippets.

@evuez
Created June 5, 2014 10:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evuez/6b5d3bd62cfbbce4eab9 to your computer and use it in GitHub Desktop.
Save evuez/6b5d3bd62cfbbce4eab9 to your computer and use it in GitHub Desktop.
import sublime, sublime_plugin
class RemoveNonBreakingCommand(sublime_plugin.TextCommand):
def run(self, edit):
if self.view.settings().get("remove_non_breaking_space") == True:
non_breaking_space = self.view.find_all(u"\u00A0")
non_breaking_space.reverse()
for r in non_breaking_space:
self.view.replace(edit, r, " ")
class RemoveNonBreakingSpace(sublime_plugin.EventListener):
def on_pre_save_async(self, view):
view.run_command('remove_non_breaking')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment