File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
src/CodingWithCalvin.GitRanger/Editor/GutterMargin Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ internal sealed class BlameMargin : Canvas, IWpfTextViewMargin
3333 private string ? _currentFilePath ;
3434 private bool _isLoading ;
3535 private bool _isDisposed ;
36+ private int _currentTooltipLine = - 1 ;
3637
3738 /// <summary>
3839 /// Creates a new blame margin for the given text view.
@@ -337,19 +338,30 @@ private void OnMouseMove(object sender, MouseEventArgs e)
337338 if ( blameInfo != null )
338339 {
339340 Cursor = Cursors . Hand ;
340- _tooltipPopup . Child = CreateTooltip ( blameInfo ) ;
341- _tooltipPopup . IsOpen = true ;
341+
342+ // Only update popup if line changed
343+ if ( _currentTooltipLine != blameInfo . LineNumber )
344+ {
345+ _currentTooltipLine = blameInfo . LineNumber ;
346+ _tooltipPopup . Child = CreateTooltip ( blameInfo ) ;
347+ _tooltipPopup . IsOpen = true ;
348+ }
342349 }
343350 else
344351 {
345352 Cursor = Cursors . Arrow ;
346- _tooltipPopup . IsOpen = false ;
353+ if ( _currentTooltipLine != - 1 )
354+ {
355+ _currentTooltipLine = - 1 ;
356+ _tooltipPopup . IsOpen = false ;
357+ }
347358 }
348359 }
349360
350361 private void OnMouseLeave ( object sender , MouseEventArgs e )
351362 {
352363 Cursor = Cursors . Arrow ;
364+ _currentTooltipLine = - 1 ;
353365 _tooltipPopup . IsOpen = false ;
354366 }
355367
You can’t perform that action at this time.
0 commit comments