Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions src/ViewModels/DiffContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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()
Expand All @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
18 changes: 9 additions & 9 deletions src/Views/DiffView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,6 @@
<Path Width="12" Height="12" Data="{StaticResource Icons.WordWrap}" Margin="0,2,0,0"/>
</ToggleButton>

<ToggleButton Classes="line_path"
Width="28"
IsChecked="{Binding Source={x:Static vm:Preferences.Instance}, Path=IgnoreWhitespaceChangesInDiff, Mode=TwoWay}"
IsVisible="{Binding IsIgnoreWhitespaceVisible, Mode=OneWay}"
ToolTip.Tip="{DynamicResource Text.Diff.IgnoreWhitespace}"
PropertyChanged="OnToggleButtonPropertyChanged">
<Path Width="14" Height="14" Stretch="Uniform" Data="{StaticResource Icons.Whitespace}"/>
</ToggleButton>

<ToggleButton Classes="line_path"
Width="28"
IsChecked="{Binding Source={x:Static vm:Preferences.Instance}, Path=ShowHiddenSymbolsInDiffView, Mode=TwoWay}"
Expand All @@ -207,6 +198,15 @@
<Path Width="12" Height="12" Data="{StaticResource Icons.Layout}" Margin="0,2,0,0"/>
</ToggleButton>

<ToggleButton Classes="line_path"
Width="28"
IsChecked="{Binding Source={x:Static vm:Preferences.Instance}, Path=IgnoreWhitespaceChangesInDiff, Mode=TwoWay}"
IsVisible="{Binding IsIgnoreWhitespaceVisible, Mode=OneWay}"
ToolTip.Tip="{DynamicResource Text.Diff.IgnoreWhitespace}"
PropertyChanged="OnToggleButtonPropertyChanged">
<Path Width="14" Height="14" Stretch="Uniform" Data="{StaticResource Icons.Whitespace}"/>
</ToggleButton>

<Button x:Name="BtnOpenExternalMergeTool"
Classes="icon_button"
Width="28"
Expand Down