File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
src/CodingWithCalvin.GitRanger/Editor/GutterMargin Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -317,17 +317,19 @@ private void DrawLineIndicator(
317317
318318 private void OnMouseLeftButtonUp ( object sender , MouseButtonEventArgs e )
319319 {
320- var position = e . GetPosition ( this ) ;
321- var blameInfo = GetBlameInfoAtPosition ( position ) ;
322- if ( blameInfo != null )
320+ // Use the current tooltip line since we already know it has blame data
321+ if ( _currentTooltipLine > 0 )
323322 {
324- // Show commit details
325- System . Windows . Clipboard . SetText ( blameInfo . CommitSha ) ;
326- ThreadHelper . JoinableTaskFactory . RunAsync ( async ( ) =>
323+ var blameInfo = _blameData . FirstOrDefault ( b => b . LineNumber == _currentTooltipLine ) ;
324+ if ( blameInfo != null )
327325 {
328- await Community . VisualStudio . Toolkit . VS . StatusBar . ShowMessageAsync (
329- $ "Git Ranger: Copied commit SHA { blameInfo . ShortSha } to clipboard") ;
330- } ) ;
326+ System . Windows . Clipboard . SetText ( blameInfo . CommitSha ) ;
327+ ThreadHelper . JoinableTaskFactory . RunAsync ( async ( ) =>
328+ {
329+ await Community . VisualStudio . Toolkit . VS . StatusBar . ShowMessageAsync (
330+ $ "Git Ranger: Copied commit SHA { blameInfo . ShortSha } to clipboard") ;
331+ } ) ;
332+ }
331333 }
332334 }
333335
You can’t perform that action at this time.
0 commit comments