}
}
public event EventHandler<TextChangeEventArgs> TextChanged;
- public virtual void OnTextChanged(object sender, TextChangeEventArgs e)
+ public void OnTextChanged(object sender, TextChangeEventArgs e)
{
if (disableTextChangedEvent)
return;
update (new TextChange (selection.Start, selection.Length, IFace.Clipboard));
}
- protected void update (TextChange change) {
+ protected virtual void update (TextChange change) {
OnTextChanged (this, new TextChangeEventArgs (change));
}
bool suggestionsActive => overlay != null && overlay.IsVisible;
- public override void OnTextChanged(object sender, TextChangeEventArgs e)
- {
- if (disableTextChangedEvent)
- return;
-
- base.OnTextChanged(sender, e);
-
- if (Document is SourceDocument srcdoc)
- srcdoc.updateCurrentTokAndNode (CurrentLoc.Value);
-
- if (!disableSuggestions && HasFocus)
- tryGetSuggestions ();
-
- RegisterForGraphicUpdate();
-
- lock (IFace.UpdateMutex) {
- if (Document is SourceDocument doc) {
- doc.NotifyValueChanged ("SyntaxRootChildNodes", (object)null);
- doc.NotifyValueChanged ("SyntaxRootChildNodes", doc.SyntaxRootChildNodes);
- CurrentNode?.ExpandToTheTop();
- }
- }
- //Console.WriteLine ($"{pos}: {suggestionTok.AsString (_text)} {suggestionTok}");
- }
-
protected void tryGetSuggestions () {
if (currentLoc.HasValue && Document is SourceDocument srcDoc) {
IList suggs = srcDoc.GetSuggestions (CurrentLoc.Value);
return cursor;
}
+ protected override void update (TextChange change) {
+ base.update (change);
+
+ if (Document is SourceDocument srcdoc)
+ srcdoc.updateCurrentTokAndNode (CurrentLoc.Value);
+
+ if (!disableSuggestions && HasFocus)
+ tryGetSuggestions ();
+
+ RegisterForGraphicUpdate();
+ lock (IFace.UpdateMutex) {
+ if (Document is SourceDocument doc) {
+ doc.NotifyValueChanged ("SyntaxRootChildNodes", (object)null);
+ doc.NotifyValueChanged ("SyntaxRootChildNodes", doc.SyntaxRootChildNodes);
+ CurrentNode?.ExpandToTheTop();
+ }
+ }
+ //Console.WriteLine ($"{pos}: {suggestionTok.AsString (_text)} {suggestionTok}");
+ }
}
}
\ No newline at end of file