increase height of a single code box upon pasting

This commit is contained in:
tophf 2017-08-29 23:53:18 +03:00
parent 22824d9ad5
commit f308d0be6c

View File

@ -396,6 +396,16 @@ function setupCodeMirror(textarea, index) {
hotkeyRerouter.setState(false);
wrapper.classList.add('CodeMirror-active');
});
cm.on('paste', () => {
if (editors.length === 1) {
setTimeout(() => {
if (cm.display.sizer.clientHeight > cm.display.wrapper.clientHeight) {
maximizeCodeHeight.stats = null;
maximizeCodeHeight(cm.getSection(), true);
}
});
}
});
if (!FIREFOX) {
cm.on('mousedown', (cm, event) => toggleContextMenuDelete.call(cm, event));
}