From 255cf51d2c603e4807d6b649c72760ebc6904197 Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Wed, 21 Jan 2015 10:53:19 +0300 Subject: [PATCH] syntax highlight fixes --- src/dlangui/widgets/editors.d | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dlangui/widgets/editors.d b/src/dlangui/widgets/editors.d index 0b3a5627..9aecc30e 100644 --- a/src/dlangui/widgets/editors.d +++ b/src/dlangui/widgets/editors.d @@ -534,9 +534,8 @@ class EditableContent { void notifyContentReplaced() { TextRange rangeBefore; TextRange rangeAfter; + // notify about content change handleContentChange(new EditOperation(EditAction.ReplaceContent), rangeBefore, rangeAfter, this); - // update highlight if necessary - updateTokenProps(0, _lines.length); } protected void updateTokenProps(int startLine, int endLine) { @@ -639,6 +638,8 @@ class EditableContent { } void handleContentChange(EditOperation op, ref TextRange rangeBefore, ref TextRange rangeAfter, Object source) { + // update highlight if necessary + updateTokenProps(rangeAfter.start.line, rangeAfter.end.line + 1); // call listeners contentChangeListeners(this, op, rangeBefore, rangeAfter, source); }