From d2af43ac1cbbffb216f5ffac1c32e8b5aeee4ebd Mon Sep 17 00:00:00 2001 From: Benoit Schweblin Date: Sat, 1 Sep 2018 18:09:05 +0100 Subject: [PATCH] Fixed #1376 --- src/services/editor/cledit/cleditCore.js | 1 + src/services/editor/cledit/cleditHighlighter.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/services/editor/cledit/cleditCore.js b/src/services/editor/cledit/cleditCore.js index 2f738b52..79ca06ab 100644 --- a/src/services/editor/cledit/cleditCore.js +++ b/src/services/editor/cledit/cleditCore.js @@ -286,6 +286,7 @@ function cledit(contentElt, scrollEltOpt, isMarkdown = false) { editor.setContent(newContent, false, min); contentChanging = true; skipSaveSelection = true; + highlighter.cancelComposition = true; } min = state.before.length; max = min + state.selection.length; diff --git a/src/services/editor/cledit/cleditHighlighter.js b/src/services/editor/cledit/cleditHighlighter.js index 3d8bb199..2b688f85 100644 --- a/src/services/editor/cledit/cleditHighlighter.js +++ b/src/services/editor/cledit/cleditHighlighter.js @@ -62,10 +62,11 @@ function Highlighter(editor) { } this.parseSections = (content, isInit) => { - if (this.isComposing) { + if (this.isComposing && !this.cancelComposition) { return sectionList; } + this.cancelComposition = false; const newSectionList = (editor.options.sectionParser ? editor.options.sectionParser(content) : [content])