using codemirror clearHistory to prevent undo-ing back to an empty buffer