File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -175,10 +175,21 @@ def on_phantom_close(self, href):
175175 else :
176176 self .view .erase_phantoms ('git-blame' )
177177
178- def run (self , edit ):
178+ def want_event (self ):
179+ return True
180+
181+ def run (self , edit , event = None ):
179182 if not view_is_suitable (self .view ):
180183 return
181184
185+ if event :
186+ # This command was ran from the context menu. Before proceeding,
187+ # move the caret to where the mouse was clicked.
188+ mouse_position = (event ["x" ], event ["y" ])
189+ text_point = self .view .window_to_text (mouse_position )
190+ self .view .sel ().clear ()
191+ self .view .sel ().add (sublime .Region (text_point ))
192+
182193 phantoms = []
183194 self .view .erase_phantoms ('git-blame' )
184195 # Before adding the phantom, see if the current phantom that is displayed is at the same spot at the selection
You can’t perform that action at this time.
0 commit comments