@@ -19,11 +19,15 @@ public string Title
1919
2020 public bool IgnoreWhitespace
2121 {
22- get => _ignoreWhitespace ;
22+ get => Preferences . Instance . IgnoreWhitespaceChangesInDiff ;
2323 set
2424 {
25- if ( SetProperty ( ref _ignoreWhitespace , value ) )
25+ if ( value != Preferences . Instance . IgnoreWhitespaceChangesInDiff )
26+ {
27+ Preferences . Instance . IgnoreWhitespaceChangesInDiff = value ;
28+ OnPropertyChanged ( ) ;
2629 LoadDiffContent ( ) ;
30+ }
2731 }
2832 }
2933
@@ -62,7 +66,6 @@ public DiffContext(string repo, Models.DiffOption option, DiffContext previous =
6266 _content = previous . _content ;
6367 _fileModeChange = previous . _fileModeChange ;
6468 _unifiedLines = previous . _unifiedLines ;
65- _ignoreWhitespace = previous . _ignoreWhitespace ;
6669 _info = previous . _info ;
6770 }
6871
@@ -114,8 +117,9 @@ private void LoadDiffContent()
114117 // There is no way to tell a git-diff to use "ALL lines of context",
115118 // so instead we set a very high number for the "lines of context" parameter.
116119 var numLines = Preferences . Instance . UseFullTextDiff ? 999999999 : _unifiedLines ;
117- var latest = new Commands . Diff ( _repo , _option , numLines , _ignoreWhitespace ) . Result ( ) ;
118- var info = new Info ( _option , numLines , _ignoreWhitespace , latest ) ;
120+ var ignoreWS = Preferences . Instance . IgnoreWhitespaceChangesInDiff ;
121+ var latest = new Commands . Diff ( _repo , _option , numLines , ignoreWS ) . Result ( ) ;
122+ var info = new Info ( _option , numLines , ignoreWS , latest ) ;
119123 if ( _info != null && info . IsSame ( _info ) )
120124 return ;
121125
@@ -287,7 +291,6 @@ public bool IsSame(Info other)
287291 private string _fileModeChange = string . Empty ;
288292 private int _unifiedLines = 4 ;
289293 private bool _isTextDiff = false ;
290- private bool _ignoreWhitespace = false ;
291294 private object _content = null ;
292295 private Info _info = null ;
293296 }
0 commit comments