mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-01 00:46:39 +01:00
Fixed SyntaxHighlighting
This commit is contained in:
@@ -3646,7 +3646,7 @@ public class TextView : View
|
||||
|
||||
_isDrawing = false;
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -281,17 +281,13 @@ public class SyntaxHighlighting : Scenario
|
||||
AllSuggestions = _keywords.ToList ()
|
||||
};
|
||||
|
||||
_textView.TextChanged += (s, e) => HighlightTextBasedOnKeywords ();
|
||||
_textView.DrawingContent += (s, e) => HighlightTextBasedOnKeywords ();
|
||||
_textView.DrawComplete += (s, e) => HighlightTextBasedOnKeywords ();
|
||||
// DrawingText happens before DrawingContent so we use it to highlight
|
||||
_textView.DrawingText += (s, e) => HighlightTextBasedOnKeywords ();
|
||||
}
|
||||
|
||||
private void ClearAllEvents ()
|
||||
{
|
||||
_textView.ClearEventHandlers ("TextChanged");
|
||||
_textView.ClearEventHandlers ("DrawContent");
|
||||
_textView.ClearEventHandlers ("DrawContentComplete");
|
||||
|
||||
_textView.ClearEventHandlers ("DrawingText");
|
||||
_textView.InheritsPreviousAttribute = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user