mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
enhance: use previous state before we get new diff result
This commit is contained in:
parent
635db8b3b3
commit
7c3c022ccc
1 changed files with 12 additions and 1 deletions
|
@ -74,7 +74,13 @@ namespace SourceGit.ViewModels
|
||||||
{
|
{
|
||||||
_repo = repo;
|
_repo = repo;
|
||||||
_option = option;
|
_option = option;
|
||||||
_content = previous != null ? previous._content : null;
|
|
||||||
|
if (previous != null)
|
||||||
|
{
|
||||||
|
_isNoChange = previous._isNoChange;
|
||||||
|
_isTextDiff = previous._isTextDiff;
|
||||||
|
_content = previous._content;
|
||||||
|
}
|
||||||
|
|
||||||
OnPropertyChanged(nameof(FilePath));
|
OnPropertyChanged(nameof(FilePath));
|
||||||
OnPropertyChanged(nameof(IsOrgFilePathVisible));
|
OnPropertyChanged(nameof(IsOrgFilePathVisible));
|
||||||
|
@ -107,16 +113,21 @@ namespace SourceGit.ViewModels
|
||||||
if (latest.IsBinary)
|
if (latest.IsBinary)
|
||||||
{
|
{
|
||||||
Content = binaryDiff;
|
Content = binaryDiff;
|
||||||
|
IsTextDiff = false;
|
||||||
|
IsNoChange = false;
|
||||||
}
|
}
|
||||||
else if (latest.IsLFS)
|
else if (latest.IsLFS)
|
||||||
{
|
{
|
||||||
Content = latest.LFSDiff;
|
Content = latest.LFSDiff;
|
||||||
|
IsTextDiff = false;
|
||||||
|
IsNoChange = false;
|
||||||
}
|
}
|
||||||
else if (latest.TextDiff != null)
|
else if (latest.TextDiff != null)
|
||||||
{
|
{
|
||||||
latest.TextDiff.File = _option.Path;
|
latest.TextDiff.File = _option.Path;
|
||||||
Content = latest.TextDiff;
|
Content = latest.TextDiff;
|
||||||
IsTextDiff = true;
|
IsTextDiff = true;
|
||||||
|
IsNoChange = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue