diff --git a/src/ViewModels/DiffContext.cs b/src/ViewModels/DiffContext.cs
index 51418baf..9d3486a1 100644
--- a/src/ViewModels/DiffContext.cs
+++ b/src/ViewModels/DiffContext.cs
@@ -51,6 +51,12 @@ namespace SourceGit.ViewModels
private set => SetProperty(ref _unifiedLines, value);
}
+ public string ChangeBlockIndicator
+ {
+ get => _changeBlockIndicator;
+ private set => SetProperty(ref _changeBlockIndicator, value);
+ }
+
public DiffContext(string repo, Models.DiffOption option, DiffContext previous = null)
{
_repo = repo;
@@ -88,6 +94,7 @@ namespace SourceGit.ViewModels
textDiff.CurrentChangeBlockIdx = 0;
}
}
+ RefreshChangeBlockIndicator();
}
public void NextChange()
@@ -104,9 +111,22 @@ namespace SourceGit.ViewModels
textDiff.CurrentChangeBlockIdx = -1;
textDiff.CurrentChangeBlockIdx = textDiff.ChangeBlocks.Count - 1;
}
+ RefreshChangeBlockIndicator();
}
}
+ public void RefreshChangeBlockIndicator()
+ {
+ string curr = "-", tot = "-";
+ if (_content is Models.TextDiff textDiff)
+ {
+ if (textDiff.CurrentChangeBlockIdx >= 0)
+ curr = (textDiff.CurrentChangeBlockIdx + 1).ToString();
+ tot = (textDiff.ChangeBlocks.Count).ToString();
+ }
+ ChangeBlockIndicator = curr + "/" + tot;
+ }
+
public void ToggleFullTextDiff()
{
Preference.Instance.UseFullTextDiff = !Preference.Instance.UseFullTextDiff;
@@ -251,7 +271,9 @@ namespace SourceGit.ViewModels
FileModeChange = latest.FileModeChange;
Content = rs;
IsTextDiff = rs is Models.TextDiff;
- });
+
+ RefreshChangeBlockIndicator();
+ });
});
}
@@ -315,6 +337,7 @@ namespace SourceGit.ViewModels
private string _title;
private string _fileModeChange = string.Empty;
private int _unifiedLines = 4;
+ private string _changeBlockIndicator = "-/-";
private bool _isTextDiff = false;
private bool _ignoreWhitespace = false;
private object _content = null;
diff --git a/src/Views/DiffView.axaml b/src/Views/DiffView.axaml
index 360ac8fc..e904f4a4 100644
--- a/src/Views/DiffView.axaml
+++ b/src/Views/DiffView.axaml
@@ -42,6 +42,13 @@
+
+