def run(self, edit):
        syntax = self.view.settings().get('syntax')
        if syntax.lower().find('python') == -1:
            return

        git_gutter_handler = GitGutterHandler(self.view)
        diff_set = get_diff_set(git_gutter_handler.diff())

        for diff in diff_set[::-1]:
            replace_region = self.view.line(
                sublime.Region(0, self.view.size()))
            source = self.view.substr(replace_region)
            self._run_for_diff(edit, source, diff)
Exemplo n.º 2
0
 def add(view):
     key = ViewCollection.get_key(view)
     try:
         from GitGutter.git_gutter_handler import GitGutterHandler
     except ImportError:
         from git_gutter_handler import GitGutterHandler
     ViewCollection.views[key] = GitGutterHandler(view)
     ViewCollection.views[key].reset()