trivial speed-ups for the single editor case

This commit is contained in:
tophf 2017-12-18 09:56:34 +03:00
parent d10e83d15c
commit 31fd551264
2 changed files with 5 additions and 0 deletions

View File

@ -455,6 +455,9 @@ function removeAreaAndSetDirty(area) {
}
function makeSectionVisible(cm) {
if (editors.length === 1) {
return;
}
const section = cm.getSection();
const bounds = section.getBoundingClientRect();
if (

View File

@ -146,6 +146,8 @@ function createSourceEditor(style) {
CodeMirror.commands.nextEditor = cm => nextPrevMozDocument(cm, 1);
CodeMirror.commands.toggleStyle = toggleStyle;
CodeMirror.commands.save = save;
CodeMirror.closestVisible = () => cm;
}
function updateMeta() {