syntax highlight fixes

This commit is contained in:
Vadim Lopatin 2015-01-21 10:53:19 +03:00
parent 7b819f6db3
commit 255cf51d2c
1 changed files with 3 additions and 2 deletions

View File

@ -534,9 +534,8 @@ class EditableContent {
void notifyContentReplaced() { void notifyContentReplaced() {
TextRange rangeBefore; TextRange rangeBefore;
TextRange rangeAfter; TextRange rangeAfter;
// notify about content change
handleContentChange(new EditOperation(EditAction.ReplaceContent), rangeBefore, rangeAfter, this); handleContentChange(new EditOperation(EditAction.ReplaceContent), rangeBefore, rangeAfter, this);
// update highlight if necessary
updateTokenProps(0, _lines.length);
} }
protected void updateTokenProps(int startLine, int endLine) { 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) { 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 // call listeners
contentChangeListeners(this, op, rangeBefore, rangeAfter, source); contentChangeListeners(this, op, rangeBefore, rangeAfter, source);
} }