codemirror / CodeMirror-v1

An editable-iframe based code editor in JavaScript. See https://github.com/marijnh/CodeMirror for the currently maintained version
http://codemirror.net/
Other
362 stars 63 forks source link

this.editor is undefined (codemirror.js row 203) #54

Closed kerray closed 8 years ago

kerray commented 13 years ago

Error is thrown in FF4 after ctrl-f5 page reload. Codemirror itself works, but subsequent code is not run. Solution seems to be simple, instead of if (this.editor.selectionSnapshot) // IE hack

I used if (this.editor && this.editor.selectionSnapshot) // IE hack

marijnh commented 13 years ago

Could it be that you have a timeout running that is trying to focus the editor? I don't think any of the timeouts (which tend to be the things that cause these kinds of errors) set by CodeMirror itself do a focus.