marijnh/CodeMirror2 — Issue #325: CodeMirror stops working after undoing to empty content
Author: njx
Created: 2012-01-11 23:22:31+00:00
State: open

1. Open the CodeMirror "theme" demo (http://codemirror.net/demo/theme.html)
2. Delete all the content in the editor
3. Type some new content
4. Cmd-Z to undo
5. Type some more

Result: Typing doesn't work. CodeMirror is throwing exceptions on each keystroke:

Uncaught TypeError: Cannot read property 'length' of undefined - codemirror.js:2286
copyStyles - codemirror.js:2286
Line.replace - codemirror.js:2073
updateLinesNoUndo - codemirror.js:550
updateLines - codemirror.js:510
replaceRange1 - codemirror.js:661
replaceSelection - codemirror.js:652
readInput - codemirror.js:716