File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 77from subprocess import check_output as shell
88
99PHANTOM_KEY_ALL = 'git-blame-all'
10+ SETTING_PHANTOM_ALL_DISPLAYED = 'git-blame-all-displayed'
1011
1112stylesheet_one = '''
1213 <style>
@@ -244,6 +245,7 @@ def run(self, edit):
244245 phantoms .append (phantom )
245246
246247 self .phantom_set .update (phantoms )
248+ self .view .settings ().set (SETTING_PHANTOM_ALL_DISPLAYED , True )
247249
248250 def get_blame_lines (self , path ):
249251 '''Run `git blame` and get the output lines.
@@ -330,10 +332,17 @@ def run(self, edit):
330332
331333class BlameEraseAllListener (sublime_plugin .ViewEventListener ):
332334
333- def on_modified (self ):
335+ @classmethod
336+ def is_applicable (cls , settings ):
337+ '''Checks if the blame_erase_all command is applicable.
338+ '''
339+ return settings .get (SETTING_PHANTOM_ALL_DISPLAYED , False )
340+
341+ def on_modified_async (self ):
334342 '''Automatically erases the blame results to prevent mismatches.
335343 '''
336344 self .view .run_command ('blame_erase_all' )
345+ self .view .settings ().erase (SETTING_PHANTOM_ALL_DISPLAYED )
337346
338347
339348class InsertCommitDescriptionCommand (sublime_plugin .TextCommand ):
You can’t perform that action at this time.
0 commit comments