Closed a7madgamal closed 7 years ago
should be all right now :)
I still get the same error :(
I've tested it on win/lin on different computers and there is no error :/ @YoYoYonnY you are working on Mac? the error comes when you are trying to reproduce error with steps in original post? or some other way? :)
Here's the new stack trace:
TypeError: Cannot read property 'text' of undefined
at Object.module.exports.EditorBackground.drawLine (/home/yyny/.atom/packages/editor-background/lib/editor-background.coffee:612:25)
at Object.module.exports.EditorBackground.drawLines (/home/yyny/.atom/packages/editor-background/lib/editor-background.coffee:727:16)
at Object.module.exports.EditorBackground.drawBackground (/home/yyny/.atom/packages/editor-background/lib/editor-background.coffee:796:18)
at /home/yyny/.atom/packages/editor-background/lib/editor-background.coffee:804:23
at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
at /usr/share/atom/resources/app.asar/src/text-editor.js:346:32
at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app.asar/node_modules/text-buffer/node_modules/event-kit/lib/emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/text-buffer/node_modules/event-kit/lib/emitter.js:129:28)
at DisplayLayer.module.exports.DisplayLayer.emitDidChangeSyncEvent (/usr/share/atom/resources/app.asar/node_modules/text-buffer/lib/display-layer.js:366:27)
at DisplayLayer.module.exports.DisplayLayer.reset (/usr/share/atom/resources/app.asar/node_modules/text-buffer/lib/display-layer.js:227:12)
at TextEditor.module.exports.TextEditor.resetDisplayLayer (/usr/share/atom/resources/app.asar/src/text-editor.js:368:32)
at TextEditor.module.exports.TextEditor.subscribeToScopedConfigSettings (/usr/share/atom/resources/app.asar/src/text-editor.js:336:19)
at /usr/share/atom/resources/app.asar/src/text-editor.js:3:61
at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
at TokenizedBuffer.module.exports.TokenizedBuffer.setGrammar (/usr/share/atom/resources/app.asar/src/tokenized-buffer.js:193:27)
at TextEditor.module.exports.TextEditor.setGrammar (/usr/share/atom/resources/app.asar/src/text-editor.js:2732:35)
at GrammarListView.module.exports.GrammarListView.confirmed (/usr/share/atom/resources/app.asar/node_modules/grammar-selector/lib/grammar-list-view.js:60:21)
at GrammarListView.module.exports.SelectListView.confirmSelection (/usr/share/atom/resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:338:21)
at HTMLLIElement.<anonymous> (/usr/share/atom/resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:139:19)
at HTMLOListElement.jQuery.event.dispatch (/usr/share/atom/resources/app.asar/node_modules/jquery/dist/jquery.js:4435:9)
at HTMLOListElement.elemData.handle (/usr/share/atom/resources/app.asar/node_modules/jquery/dist/jquery.js:4121:28)
v1.2.27 ?
Yep.
ok i will investigate that bug
I reinstalled to make sure, but I did have v1.2.27.
ok
Also, I'm not on Mac, but on Ubuntu. Don't think it matters, though.
It seems like a problem with CoffeeScript?
for line in attrs.screenLines
Should never make line
undefined.
I will let you know in about few hours from now because I'm in work now :)
I have nothing to do, I can take a look, but it does look like the only way for line
to become undefined is when attrs.screenLines
is modified, or has an undefined
in there from the start.
I believe the underlying problem is on line 772
. It does indeed look like a problem with CoffeeScript.
tokenizedLines[ actualLines[0]..actualLines[1] ]
returns an array with .length
1
, But with no actual index 0
, e.g.:
var array = [];
array.length = 1;
console.log(array); // `[]`, notice how it doesn't print `[undefined]`.
console.log(array.length); // `1`
[Enter steps to reproduce below:]
Atom Version: 1.10.2 Electron Version: 0.37.8 System: Mac OS X 10.11.6 Thrown From: editor-background package, v1.2.23
Stack Trace
Uncaught TypeError: Cannot read property 'text' of undefined
Commands
Config
Installed Packages