diff --git a/edit/sections-editor-section.js b/edit/sections-editor-section.js index 572fc6e0..f4b21cc9 100644 --- a/edit/sections-editor-section.js +++ b/edit/sections-editor-section.js @@ -121,7 +121,6 @@ function createSection({ el, cm, render, - getCode, getModel, remove, destroy, @@ -265,10 +264,6 @@ function createSection({ showHelp(t('appliesLabel'), t('appliesHelp')); } - function getCode() { - return cm.getValue(); - } - function remove() { linter.disableForEditor(cm); el.classList.add('removed'); diff --git a/edit/sections-editor.js b/edit/sections-editor.js index 1fae9a07..96df2e83 100644 --- a/edit/sections-editor.js +++ b/edit/sections-editor.js @@ -485,7 +485,7 @@ function createSectionsEditor(style) { if (sections.every(s => s.isRemoved() || s === section)) { throw new Error('Cannot remove last section'); } - if (!section.getCode()) { + if (section.cm.isBlank()) { const index = sections.indexOf(section); sections.splice(index, 1); section.el.remove();