@@ -233,6 +233,7 @@ public Models.BlameData BlameData
233
233
TextArea . LeftMargins . Add ( new VerticalSeperatorMargin ( this ) ) ;
234
234
TextArea . LeftMargins . Add ( new CommitInfoMargin ( this ) { Margin = new Thickness ( 8 , 0 ) } ) ;
235
235
TextArea . LeftMargins . Add ( new VerticalSeperatorMargin ( this ) ) ;
236
+ TextArea . Caret . PositionChanged += OnTextAreaCaretPositionChanged ;
236
237
TextArea . LayoutUpdated += OnTextAreaLayoutUpdated ;
237
238
TextArea . PointerWheelChanged += OnTextAreaPointerWheelChanged ;
238
239
TextArea . TextView . ContextRequested += OnTextViewContextRequested ;
@@ -279,7 +280,9 @@ protected override void OnUnloaded(RoutedEventArgs e)
279
280
base . OnUnloaded ( e ) ;
280
281
281
282
TextArea . LeftMargins . Clear ( ) ;
283
+ TextArea . Caret . PositionChanged -= OnTextAreaCaretPositionChanged ;
282
284
TextArea . LayoutUpdated -= OnTextAreaLayoutUpdated ;
285
+ TextArea . PointerWheelChanged -= OnTextAreaPointerWheelChanged ;
283
286
TextArea . TextView . ContextRequested -= OnTextViewContextRequested ;
284
287
TextArea . TextView . VisualLinesChanged -= OnTextViewVisualLinesChanged ;
285
288
@@ -312,7 +315,7 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs chang
312
315
}
313
316
}
314
317
315
- private void OnTextAreaLayoutUpdated ( object sender , EventArgs e )
318
+ private void OnTextAreaCaretPositionChanged ( object sender , EventArgs e )
316
319
{
317
320
if ( ! TextArea . IsFocused )
318
321
return ;
@@ -325,6 +328,12 @@ private void OnTextAreaLayoutUpdated(object sender, EventArgs e)
325
328
InvalidateVisual ( ) ;
326
329
}
327
330
331
+ private void OnTextAreaLayoutUpdated ( object sender , EventArgs e )
332
+ {
333
+ if ( TextArea . IsFocused )
334
+ InvalidateVisual ( ) ;
335
+ }
336
+
328
337
private void OnTextAreaPointerWheelChanged ( object sender , PointerWheelEventArgs e )
329
338
{
330
339
if ( ! TextArea . IsFocused && ! string . IsNullOrEmpty ( _highlight ) )
0 commit comments