mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 18:32:41 +00:00
Tell CodeMirror to batch custom highlights before updating the browser
This commit is contained in:
@@ -107,6 +107,8 @@ const Editor = createClass({
|
||||
if(this.state.view === 'text') {
|
||||
const codeMirror = this.refs.codeEditor.codeMirror;
|
||||
|
||||
codeMirror.startOperation();
|
||||
|
||||
//reset custom text styles
|
||||
const customHighlights = codeMirror.getAllMarks().filter((mark)=>!mark.__isFold); //Don't undo code folding
|
||||
for (let i=customHighlights.length - 1;i>=0;i--) customHighlights[i].clear();
|
||||
@@ -168,6 +170,8 @@ const Editor = createClass({
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
codeMirror.endOperation();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user