This commit is contained in:
Benoit Schweblin 2018-09-01 18:09:05 +01:00
parent f7f66ba249
commit d2af43ac1c
2 changed files with 3 additions and 1 deletions

View File

@ -286,6 +286,7 @@ function cledit(contentElt, scrollEltOpt, isMarkdown = false) {
editor.setContent(newContent, false, min); editor.setContent(newContent, false, min);
contentChanging = true; contentChanging = true;
skipSaveSelection = true; skipSaveSelection = true;
highlighter.cancelComposition = true;
} }
min = state.before.length; min = state.before.length;
max = min + state.selection.length; max = min + state.selection.length;

View File

@ -62,10 +62,11 @@ function Highlighter(editor) {
} }
this.parseSections = (content, isInit) => { this.parseSections = (content, isInit) => {
if (this.isComposing) { if (this.isComposing && !this.cancelComposition) {
return sectionList; return sectionList;
} }
this.cancelComposition = false;
const newSectionList = (editor.options.sectionParser const newSectionList = (editor.options.sectionParser
? editor.options.sectionParser(content) ? editor.options.sectionParser(content)
: [content]) : [content])