@@ -51,6 +51,12 @@ public int UnifiedLines
51
51
private set => SetProperty ( ref _unifiedLines , value ) ;
52
52
}
53
53
54
+ public string ChangeBlockIndicator
55
+ {
56
+ get => _changeBlockIndicator ;
57
+ private set => SetProperty ( ref _changeBlockIndicator , value ) ;
58
+ }
59
+
54
60
public DiffContext ( string repo , Models . DiffOption option , DiffContext previous = null )
55
61
{
56
62
_repo = repo ;
@@ -88,6 +94,7 @@ public void PrevChange()
88
94
textDiff . CurrentChangeBlockIdx = 0 ;
89
95
}
90
96
}
97
+ RefreshChangeBlockIndicator ( ) ;
91
98
}
92
99
93
100
public void NextChange ( )
@@ -104,7 +111,20 @@ public void NextChange()
104
111
textDiff . CurrentChangeBlockIdx = - 1 ;
105
112
textDiff . CurrentChangeBlockIdx = textDiff . ChangeBlocks . Count - 1 ;
106
113
}
114
+ RefreshChangeBlockIndicator ( ) ;
115
+ }
116
+ }
117
+
118
+ public void RefreshChangeBlockIndicator ( )
119
+ {
120
+ string curr = "-" , tot = "-" ;
121
+ if ( _content is Models . TextDiff textDiff )
122
+ {
123
+ if ( textDiff . CurrentChangeBlockIdx >= 0 )
124
+ curr = ( textDiff . CurrentChangeBlockIdx + 1 ) . ToString ( ) ;
125
+ tot = ( textDiff . ChangeBlocks . Count ) . ToString ( ) ;
107
126
}
127
+ ChangeBlockIndicator = curr + "/" + tot ;
108
128
}
109
129
110
130
public void ToggleFullTextDiff ( )
@@ -251,7 +271,9 @@ private void LoadDiffContent()
251
271
FileModeChange = latest . FileModeChange ;
252
272
Content = rs ;
253
273
IsTextDiff = rs is Models . TextDiff ;
254
- } ) ;
274
+
275
+ RefreshChangeBlockIndicator ( ) ;
276
+ } ) ;
255
277
} ) ;
256
278
}
257
279
@@ -315,6 +337,7 @@ public bool IsSame(Info other)
315
337
private string _title ;
316
338
private string _fileModeChange = string . Empty ;
317
339
private int _unifiedLines = 4 ;
340
+ private string _changeBlockIndicator = "-/-" ;
318
341
private bool _isTextDiff = false ;
319
342
private bool _ignoreWhitespace = false ;
320
343
private object _content = null ;
0 commit comments