Created
November 1, 2013 10:59
-
-
Save MaciekBaron/7263887 to your computer and use it in GitHub Desktop.
Plugin for highlighting TODOs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin | |
combinations = (('todo', '(.*)TODO:(.*)', 'variable.parameter'), ('fix','(.*)FIX:(.*)', 'invalid.depricated'), ('notabene', '(.*)NB:(.*)', 'string')) | |
class HighlightText(sublime_plugin.TextCommand): | |
def run(self, edit): | |
view = self.view | |
for combination in combinations: | |
view.add_regions(combination[0], view.find_all(combination[1],0), combination[2], '') | |
class HighlightOnSave(sublime_plugin.EventListener): | |
def on_activated(self, view): | |
view.run_command("highlight_text") | |
def on_modified_async(self, view): | |
view.run_command("highlight_text") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment