mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-26 21:17:20 -08:00
Prev/next will (re-)scroll to first/last change-block in edge-cases
I.e when unset or already at first/last change-block (or the only one).
This commit is contained in:
parent
e0c219b46d
commit
96a9019487
1 changed files with 16 additions and 2 deletions
|
@ -78,9 +78,15 @@ namespace SourceGit.ViewModels
|
|||
if (_content is Models.TextDiff textDiff)
|
||||
{
|
||||
if (textDiff.CurrentChangeBlockIdx > 0)
|
||||
{
|
||||
textDiff.CurrentChangeBlockIdx--;
|
||||
else if (textDiff.CurrentChangeBlockIdx == -1 && textDiff.ChangeBlocks.Count > 0)
|
||||
textDiff.CurrentChangeBlockIdx = 0; // Jump to first change block
|
||||
}
|
||||
else if (textDiff.ChangeBlocks.Count > 0)
|
||||
{
|
||||
// Force property value change and (re-)jump to first change block
|
||||
textDiff.CurrentChangeBlockIdx = -1;
|
||||
textDiff.CurrentChangeBlockIdx = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,8 +95,16 @@ namespace SourceGit.ViewModels
|
|||
if (_content is Models.TextDiff textDiff)
|
||||
{
|
||||
if (textDiff.CurrentChangeBlockIdx < textDiff.ChangeBlocks.Count - 1)
|
||||
{
|
||||
textDiff.CurrentChangeBlockIdx++;
|
||||
}
|
||||
else if (textDiff.ChangeBlocks.Count > 0)
|
||||
{
|
||||
// Force property value change and (re-)jump to last change block
|
||||
textDiff.CurrentChangeBlockIdx = -1;
|
||||
textDiff.CurrentChangeBlockIdx = textDiff.ChangeBlocks.Count - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ToggleFullTextDiff()
|
||||
|
|
Loading…
Reference in a new issue