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 7
7
from subprocess import check_output as shell
8
8
9
9
PHANTOM_KEY_ALL = 'git-blame-all'
10
+ SETTING_PHANTOM_ALL_DISPLAYED = 'git-blame-all-displayed'
10
11
11
12
stylesheet_one = '''
12
13
<style>
@@ -244,6 +245,7 @@ def run(self, edit):
244
245
phantoms .append (phantom )
245
246
246
247
self .phantom_set .update (phantoms )
248
+ self .view .settings ().set (SETTING_PHANTOM_ALL_DISPLAYED , True )
247
249
248
250
def get_blame_lines (self , path ):
249
251
'''Run `git blame` and get the output lines.
@@ -330,10 +332,17 @@ def run(self, edit):
330
332
331
333
class BlameEraseAllListener (sublime_plugin .ViewEventListener ):
332
334
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 ):
334
342
'''Automatically erases the blame results to prevent mismatches.
335
343
'''
336
344
self .view .run_command ('blame_erase_all' )
345
+ self .view .settings ().erase (SETTING_PHANTOM_ALL_DISPLAYED )
337
346
338
347
339
348
class InsertCommitDescriptionCommand (sublime_plugin .TextCommand ):
You can’t perform that action at this time.
0 commit comments