mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-24 13:45:00 +00:00
feature: add a button in diff view to ignore all whitespace changes (--ignore-all-space)
This commit is contained in:
parent
c1f6da1b31
commit
d2a005c532
10 changed files with 44 additions and 17 deletions
|
@ -17,6 +17,16 @@ namespace SourceGit.ViewModels
|
|||
get => _title;
|
||||
}
|
||||
|
||||
public bool IgnoreWhitespace
|
||||
{
|
||||
get => _ignoreWhitespace;
|
||||
set
|
||||
{
|
||||
if (SetProperty(ref _ignoreWhitespace, value))
|
||||
LoadDiffContent();
|
||||
}
|
||||
}
|
||||
|
||||
public string FileModeChange
|
||||
{
|
||||
get => _fileModeChange;
|
||||
|
@ -57,6 +67,7 @@ namespace SourceGit.ViewModels
|
|||
_isTextDiff = previous._isTextDiff;
|
||||
_content = previous._content;
|
||||
_unifiedLines = previous._unifiedLines;
|
||||
_ignoreWhitespace = previous._ignoreWhitespace;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(_option.OrgPath) || _option.OrgPath == "/dev/null")
|
||||
|
@ -98,7 +109,7 @@ namespace SourceGit.ViewModels
|
|||
|
||||
Task.Run(() =>
|
||||
{
|
||||
var latest = new Commands.Diff(_repo, _option, _unifiedLines).Result();
|
||||
var latest = new Commands.Diff(_repo, _option, _unifiedLines, _ignoreWhitespace).Result();
|
||||
var rs = null as object;
|
||||
|
||||
if (latest.TextDiff != null)
|
||||
|
@ -237,6 +248,7 @@ namespace SourceGit.ViewModels
|
|||
private int _unifiedLines = 4;
|
||||
private bool _isLoading = true;
|
||||
private bool _isTextDiff = false;
|
||||
private bool _ignoreWhitespace = false;
|
||||
private object _content = null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue