Closed MiguelCastillo closed 11 years ago
I cannot reproduce the error with that file. I'm guessing it is being thrown from line 105?
Yeah, my bad. I should provided you with a stack trace. Quick assumption, adding a gutter marker failed and then you try access it anyway.
Uncaught TypeError: Cannot read property 'textContent' of undefined main.js:105 _toggleLineMarker main.js:105 (anonymous function) main.js:126 _decorateGutters main.js:125 _handleScroll main.js:189 f.event.dispatch jquery-1.7.min.js:3 f.event.add.h.handle.i jquery-1.7.min.js:3 f.event.trigger jquery-1.7.min.js:3 f.fn.extend.triggerHandler jquery-1.7.min.js:3 Editor._installEditorListeners._codeMirror.on.self._focused Editor.js:655 signal codemirror.js:5093 (anonymous function)
Quick debug and lInfo.gutterMarkers is undefined when the issue occurs... You might want to keep track of your markers yourself and reset them everytime a new document is opened
Cool thanks. Although I guess lInfo.gutterMarkers["code-folding-gutter"] must be undefined since there is a condition in the preceding line that checks that lInfo.gutterMarkers is defined (line 104)...?
I am using a mousewheel and the issue seems to occur when scrolling kinda fast. If you scroll slow enough, the issue won't happen. So, I am thinking that you are trying to access gutter value before they are created by CodeMirror.
Yeah, you should keep track of you marker manually
The issue happens with some files... I haven't been able to pin point it to a size or anything, but this file will reproduce the issue.
https://github.com/MiguelCastillo/Brackets-Tern/blob/master/TernReferences.js
Load it up in Brackets and scroll down.