mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-20 11:44:59 +00:00
feature: Allows you to show space and tab symbols in DiffView
This commit is contained in:
parent
3dc32c87a8
commit
9c7ac5b067
8 changed files with 51 additions and 3 deletions
|
@ -105,6 +105,23 @@ namespace SourceGit.Views
|
|||
set => SetValue(UseSyntaxHighlightingProperty, value);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ShowHiddenSymbols StyledProperty definition
|
||||
/// </summary>
|
||||
public static readonly StyledProperty<bool> ShowHiddenSymbolsProperty =
|
||||
AvaloniaProperty.Register<IThemedTextDiffPresenter, bool>(nameof(ShowHiddenSymbols));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ShowHiddenSymbols property. This StyledProperty
|
||||
/// indicates thath show hidden symbol like space and tab
|
||||
/// </summary>
|
||||
public bool ShowHiddenSymbols
|
||||
{
|
||||
get => this.GetValue(ShowHiddenSymbolsProperty);
|
||||
set => SetValue(ShowHiddenSymbolsProperty, value);
|
||||
}
|
||||
|
||||
protected override Type StyleKeyOverride => typeof(TextEditor);
|
||||
|
||||
public IThemedTextDiffPresenter(TextArea area, TextDocument doc) : base(area, doc)
|
||||
|
@ -141,6 +158,12 @@ namespace SourceGit.Views
|
|||
|
||||
if (change.Property == UseSyntaxHighlightingProperty)
|
||||
UpdateTextMate();
|
||||
else if(change.Property == ShowHiddenSymbolsProperty)
|
||||
{
|
||||
var showHiddenSymbols = change.NewValue is true;
|
||||
this.Options.ShowTabs = showHiddenSymbols;
|
||||
this.Options.ShowSpaces = showHiddenSymbols;
|
||||
}
|
||||
else if (change.Property == FileNameProperty)
|
||||
Models.TextMateHelper.SetGrammarByFileName(_textMate, FileName);
|
||||
else if (change.Property.Name == "ActualThemeVariant" && change.NewValue != null)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue