diff --git a/src/ViewModels/DiffContext.cs b/src/ViewModels/DiffContext.cs index 05e50431f..59204feb2 100644 --- a/src/ViewModels/DiffContext.cs +++ b/src/ViewModels/DiffContext.cs @@ -85,12 +85,12 @@ public void OpenExternalMergeTool() public void CheckSettings() { + var pref = Preferences.Instance; + if (Content is TextDiffContext ctx) { - var pref = Preferences.Instance; - - if ((pref.UseFullTextDiff && _info.UnifiedLines != _entireFileLine) || - (!pref.UseFullTextDiff && _info.UnifiedLines == _entireFileLine) || + if ((pref.UseFullTextDiff && _info.UnifiedLines != _entireFileLines) || + (!pref.UseFullTextDiff && _info.UnifiedLines == _entireFileLines) || (pref.IgnoreWhitespaceChangesInDiff != _info.IgnoreWhitespace)) { LoadContent(); @@ -100,6 +100,11 @@ public void CheckSettings() if (ctx.IsSideBySide() != pref.UseSideBySideDiff) Content = ctx.SwitchMode(); } + else if (Content is Models.NoOrEOLChange) + { + if (pref.IgnoreWhitespaceChangesInDiff != _info.IgnoreWhitespace) + LoadContent(); + } } private void LoadContent() @@ -114,7 +119,7 @@ private void LoadContent() Task.Run(async () => { var pref = Preferences.Instance; - var numLines = pref.UseFullTextDiff ? _entireFileLine : _unifiedLines; + var numLines = pref.UseFullTextDiff ? _entireFileLines : _unifiedLines; var ignoreWhitespace = pref.IgnoreWhitespaceChangesInDiff; var ignoreCRAtEOL = pref.IgnoreCRAtEOLInDiff; @@ -326,7 +331,7 @@ public bool IsSame(Info other) } } - private readonly int _entireFileLine = 999999999; + private readonly int _entireFileLines = 999999999; private readonly string _repo; private readonly Models.DiffOption _option = null; private string _fileModeChange = string.Empty; diff --git a/src/Views/DiffView.axaml b/src/Views/DiffView.axaml index 1ae5083ee..d797f1d3e 100644 --- a/src/Views/DiffView.axaml +++ b/src/Views/DiffView.axaml @@ -180,15 +180,6 @@ - - - - + + + +