Closed derrickwheals closed 7 years ago
I'm getting the same error since 1-2 days. Don't know how to reproduce on an unaffected system, but it happens every time I open a new file (any file, with or without custom-fold selectors). It does however disappear, if I deselect "Auto fold on file open?" in the custom-folds settings.
Atom: 1.17.0 x64 Electron: 1.3.15 OS: Mac OS X 10.12.3 Thrown From: custom-folds package 1.9.3
-8:33 tree-view:toggle (input.hidden-input)
Thanks! I've been buried at work lately but I'll try and review this today.
Don't worry, I can get that too with work =)
I'm looking through it a bit, and found out that atom.workspace.getActiveTextEditor() returns "undefined".
I also noticed that the error does NOT pop up, when a file is actually opened.
So actually the error shows up only when a file is "looked at quickly", and the title stays in italics. Don't know how to better describe it =) It's called Preview Tabs or Pending Pane Items
This seems to be still a bug in the atom-tab-preview package.
I didn't dig further into it, but did a quick hack for myself, to only give me a warning (that disappears). I added the following code at .atom/packages/custom-folds/lib/index.js:243:3, within the fold-all()
method, right after CustomFolds._getOptions();
const { editor, commentChars, areCommentsRequired, prefixes, postfixes } = CustomFolds._getOptions();
// FLU: Added code for Debugging
// PROBLEM: getActiveTextEditor() returns "undefined" with *Pending Pane Items*
// TODO: Fix "Auto-fold on file open?" with *Pending Pane Items*, by having it return something real..?
if(!editor) {
atom.notifications.addWarning(`Editor is not defined in the Pending Pane Item, as atom.workspace.getActiveTextEditor() = ${atom.workspace.getActiveTextEditor()}. Not auto-folding within Pending Pane Items.`);
return;
}
That's it for today =) Do you want me to push the changes to somewhere? Or you might want to implement the actual correction of the bug.. If it bothers me, I'll go further into the rabbit's hole and maybe report the bug with the atom-tab-preview team.
Thanks, the repro steps were extremely helpful! Fixed in 1.9.4.
And now it even folds while a file is viewed as a Pending Pane Item! Fantastic ;-) Keep up the good work with this great package
[Enter steps to reproduce:]
Atom: 1.17.0 ia32 Electron: 1.3.15 OS: Microsoft Windows 10 Enterprise Thrown From: custom-folds package 1.9.3
Stack Trace
Uncaught TypeError: Cannot read property 'getLineCount' of undefined
Commands
Non-Core Packages