Skip to content

Commit

Permalink
Fix: Column ruler behind current line highlight.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgarstenauer committed Jun 9, 2023
1 parent d6b2c05 commit 3f42e80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/AvaloniaEdit/Rendering/CurrentLineHighlightRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public int Line {
}
}

public KnownLayer Layer => KnownLayer.Selection;
public KnownLayer Layer => KnownLayer.Background;

public IBrush BackgroundBrush {
get; set;
Expand Down
12 changes: 6 additions & 6 deletions src/AvaloniaEdit/Rendering/TextView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static TextView()
}

private readonly ColumnRulerRenderer _columnRulerRenderer;
private readonly CurrentLineHighlightRenderer _currentLineHighlighRenderer;
private readonly CurrentLineHighlightRenderer _currentLineHightlighRenderer;

/// <summary>
/// Creates a new TextView instance.
Expand All @@ -79,8 +79,8 @@ public TextView()
_elementGenerators = new ObserveAddRemoveCollection<VisualLineElementGenerator>(ElementGenerator_Added, ElementGenerator_Removed);
_lineTransformers = new ObserveAddRemoveCollection<IVisualLineTransformer>(LineTransformer_Added, LineTransformer_Removed);
_backgroundRenderers = new ObserveAddRemoveCollection<IBackgroundRenderer>(BackgroundRenderer_Added, BackgroundRenderer_Removed);
_currentLineHightlighRenderer = new CurrentLineHighlightRenderer(this);
_columnRulerRenderer = new ColumnRulerRenderer(this);
_currentLineHighlighRenderer = new CurrentLineHighlightRenderer(this);
Options = new TextEditorOptions();

Debug.Assert(_singleCharacterElementGenerator != null); // assert that the option change created the builtin element generators
Expand Down Expand Up @@ -1929,11 +1929,11 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs chang
}
if (change.Property == CurrentLineBorderProperty)
{
_currentLineHighlighRenderer.BorderPen = CurrentLineBorder;
_currentLineHightlighRenderer.BorderPen = CurrentLineBorder;
}
if (change.Property == CurrentLineBackgroundProperty)
{
_currentLineHighlighRenderer.BackgroundBrush = CurrentLineBackground;
_currentLineHightlighRenderer.BackgroundBrush = CurrentLineBackground;
}
}

Expand Down Expand Up @@ -2028,8 +2028,8 @@ public IPen CurrentLineBorder
/// </summary>
public int HighlightedLine
{
get => _currentLineHighlighRenderer.Line;
set => _currentLineHighlighRenderer.Line = value;
get => _currentLineHightlighRenderer.Line;
set => _currentLineHightlighRenderer.Line = value;
}

/// <summary>
Expand Down

0 comments on commit 3f42e80

Please sign in to comment.