@@ -543,6 +543,21 @@ public virtual void UpdateSelectedChunk(double y)
543543 {
544544 }
545545
546+ public void GotoFirstChange ( )
547+ {
548+ var blockNavigation = BlockNavigation ;
549+ if ( blockNavigation != null )
550+ {
551+ var prev = blockNavigation . GotoFirst ( ) ;
552+ if ( prev != null )
553+ {
554+ TextArea . Caret . Line = prev . Start ;
555+ ScrollToLine ( prev . Start ) ;
556+ }
557+ }
558+ // NOTE: Not implemented (button hidden) for non-block navigation.
559+ }
560+
546561 public void GotoPrevChange ( )
547562 {
548563 var blockNavigation = BlockNavigation ;
@@ -641,6 +656,21 @@ public void GotoNextChange()
641656 }
642657 }
643658
659+ public void GotoLastChange ( )
660+ {
661+ var blockNavigation = BlockNavigation ;
662+ if ( blockNavigation != null )
663+ {
664+ var next = blockNavigation . GotoLast ( ) ;
665+ if ( next != null )
666+ {
667+ TextArea . Caret . Line = next . Start ;
668+ ScrollToLine ( next . Start ) ;
669+ }
670+ }
671+ // NOTE: Not implemented (button hidden) for non-block navigation.
672+ }
673+
644674 public override void Render ( DrawingContext context )
645675 {
646676 base . Render ( context ) ;
@@ -1682,6 +1712,19 @@ public TextDiffView()
16821712 InitializeComponent ( ) ;
16831713 }
16841714
1715+ public void GotoFirstChange ( )
1716+ {
1717+ var presenter = this . FindDescendantOfType < ThemedTextDiffPresenter > ( ) ;
1718+ if ( presenter == null )
1719+ return ;
1720+
1721+ presenter . GotoFirstChange ( ) ;
1722+ if ( presenter is SingleSideTextDiffPresenter singleSide )
1723+ singleSide . ForceSyncScrollOffset ( ) ;
1724+
1725+ BlockNavigationIndicator = BlockNavigation ? . Indicator ?? string . Empty ;
1726+ }
1727+
16851728 public void GotoPrevChange ( )
16861729 {
16871730 var presenter = this . FindDescendantOfType < ThemedTextDiffPresenter > ( ) ;
@@ -1708,6 +1751,19 @@ public void GotoNextChange()
17081751 BlockNavigationIndicator = BlockNavigation ? . Indicator ?? string . Empty ;
17091752 }
17101753
1754+ public void GotoLastChange ( )
1755+ {
1756+ var presenter = this . FindDescendantOfType < ThemedTextDiffPresenter > ( ) ;
1757+ if ( presenter == null )
1758+ return ;
1759+
1760+ presenter . GotoLastChange ( ) ;
1761+ if ( presenter is SingleSideTextDiffPresenter singleSide )
1762+ singleSide . ForceSyncScrollOffset ( ) ;
1763+
1764+ BlockNavigationIndicator = BlockNavigation ? . Indicator ?? string . Empty ;
1765+ }
1766+
17111767 protected override void OnDataContextChanged ( EventArgs e )
17121768 {
17131769 base . OnDataContextChanged ( e ) ;
0 commit comments