Skip to content

Commit 2d530c1

Browse files
authored
Merge pull request #18 from brentswisher/sameline-toggle-hide
When run is called, check if the selection is at the same line as the…
2 parents 03519f9 + aeaf337 commit 2d530c1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

git-blame.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,11 @@ def on_phantom_close(self, href):
177177
def run(self, edit):
178178
phantoms = []
179179
self.view.erase_phantoms('git-blame')
180-
180+
#Before adding the phantom, see if the current phantom that is displayed is at the same spot at the selection
181+
if self.phantom_set.phantoms and self.view.line(self.view.sel()[0]) == self.view.line(self.phantom_set.phantoms[0].region):
182+
self.phantom_set.update(phantoms)
183+
return
184+
181185
for region in self.view.sel():
182186
line = self.view.line(region)
183187
(row, col) = self.view.rowcol(region.begin())

0 commit comments

Comments
 (0)