oriolmirosa / open-files

Atom package to show the open files in the tree-view panel, mirroring the functionality in Sublime Text
https://atom.io/packages/open-files
MIT License
15 stars 10 forks source link

Uncaught TypeError: Cannot read property 'element' of undefined #10

Closed pipic1 closed 7 years ago

pipic1 commented 7 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.16.0 x64 Electron: 1.3.13 OS: Unknown Windows version Thrown From: open-files package 0.5.2

Stack Trace

Uncaught TypeError: Cannot read property 'element' of undefined

At C:\Users\Utilisateur externe\.atom\packages\open-files\lib\open-files-pane-view.js:222

TypeError: Cannot read property 'element' of undefined
    at OpenFilesPaneView.updateModifiedState (/packages/open-files/lib/open-files-pane-view.js:222:15)
    at /packages/open-files/lib/open-files-pane-view.js:177:18
    at Function.module.exports.Emitter.simpleDispatch (/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/app.asar/node_modules/event-kit/lib/emitter.js:141:28)
    at TextBuffer.module.exports.TextBuffer.emitModifiedStatusChanged (/app.asar/node_modules/text-buffer/lib/text-buffer.js:1407:27)
    at /app.asar/node_modules/text-buffer/lib/text-buffer.js:1396:24

Commands

  7x -6:22.2.0 core:backspace (input.hidden-input)
undefined -6:16.2.0 intentions:highlight (input.hidden-input)
     -6:11.4.0 editor:select-to-end-of-word (input.hidden-input)
     -6:10.7.0 intentions:highlight (input.hidden-input)
     -6:10.5.0 core:copy (input.hidden-input)
     -6:10.3.0 core:move-left (input.hidden-input)
     -5:26.7.0 core:backspace (input.hidden-input)
     -3:06.7.0 intentions:highlight (input.hidden-input)
  2x -3:06.5.0 core:undo (input.hidden-input)
     -3:02.9.0 core:backspace (input.hidden-input)
     -3:01.9.0 intentions:highlight (input.hidden-input)
     -3:01.7.0 core:save (input.hidden-input)
     -1:01.6.0 tree-view:remove (span.name.icon.icon-file-text)
     -0:14 editor:newline (input.hidden-input)
     -0:13.2.0 intentions:highlight (input.hidden-input)
     -0:13 core:paste (input.hidden-input)

Non-Core Packages

busy-signal 1.4.0 
compare-files 0.8.0 
highlight-selected 0.13.1 
intentions 1.1.2 
linter 2.1.4 
linter-ui-default 1.2.3 
markdown-preview-opener 0.1.1 
minimap 4.27.1 
minimap-highlight-selected 4.6.1 
minimap-pigments 0.2.2 
open-files 0.5.2 
pigments 0.39.1 
svn 0.0.13 
todo-show 1.11.0 
tortoise-svn 0.5.0 
oriolmirosa commented 7 years ago

I can't reproduce the issue. Am I correct that you were just deleting a word in a file when the error message appeared? Can you tell me what kind of file you were editing when this happened?

pipic1 commented 7 years ago

Hi, yes when a deleting a word in a file, the message appears and also when I save it. I work with Embedded RuBy (with double file extension example_file.html.erb)

oriolmirosa commented 7 years ago

I added all of your packages to my Atom installation and tried with an .html.erb file and I still can't reproduce the problem. It all works fine for me. I wonder if this is a Windows problem (I use OS X and I don't have access to a Windows system, so I can't try it there). Does the problem file appear in the 'Open Files' list before you try to erase and save, or does it not even appear there? Does that happen with other .html.erb files? Does it happen with other types of files at all?

erwango commented 7 years ago

I get the same error with c files. When deleting a line I get the same error:

TypeError: Cannot read property 'element' of undefined at OpenFilesPaneView.updateModifiedState (/local/home/frq07517/.atom/packages/open-files/lib/open-files-pane-view.js:221:15) at /local/home/frq07517/.atom/packages/open-files/lib/open-files-pane-view.js:176:18 at Function.module.exports.Emitter.simpleDispatch (/opt/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14) at Emitter.module.exports.Emitter.emit (/opt/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:129:28) at TextBuffer.module.exports.TextBuffer.emitModifiedStatusChanged (/opt/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1386:27) at /opt/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1375:24

It is not systematic though, and I can't identify a pattern to reproduce it.

oriolmirosa commented 7 years ago

I still can't reproduce, but I made some changes that might take care of this. Can you please let me know if the problem is still there? Thanks!

J-Mills commented 7 years ago

I also found this problem but only when I had two or more files open and split them between panes.

oriolmirosa commented 7 years ago

Damn. I was hoping this would be fixed. I tried to split files between panes and I still can't reproduce the bug. @J-Mills , could you please give me more details about your setup, and how exactly you got the problem to appear? Thanks!

J-Mills commented 7 years ago

Really sorry I didn't get back to you sooner! I didn't get a notification for your reply.

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.17.0 x64 Electron: 1.3.15 OS: Microsoft Windows 10 Education Thrown From: open-files package 0.5.5

Stack Trace

Uncaught TypeError: Cannot read property 'element' of undefined

At C:\Users\Jack\.atom\packages\open-files\lib\open-files-pane-view.js:230

TypeError: Cannot read property 'element' of undefined
    at OpenFilesPaneView.updateModifiedState (/packages/open-files/lib/open-files-pane-view.js:230:15)
    at /packages/open-files/lib/open-files-pane-view.js:181:20
    at Function.module.exports.Emitter.simpleDispatch (~/AppData/Local/atom/app-1.17.0/resources/app/node_modules/event-kit/lib/emitter.js:25:1)
    at Emitter.module.exports.Emitter.emit (~/AppData/Local/atom/app-1.17.0/resources/app/node_modules/event-kit/lib/emitter.js:141:1)
    at TextBuffer.module.exports.TextBuffer.emitModifiedStatusChanged (~/AppData/Local/atom/app-1.17.0/resources/app/node_modules/text-buffer/lib/text-buffer.js:1457:1)
    at ~/AppData/Local/atom/app-1.17.0/resources/app/node_modules/text-buffer/lib/text-buffer.js:1446:1

Commands

     -2:44.3.0 tree-view:show (atom-workspace.workspace.scrollbars-visible-always)
     -2:21.2.0 settings-view:open (div.tool-panel.tree-view)
     -0:15.7.0 docblockr:parse-enter (input.hidden-input)
     -0:15.7.0 editor:newline (input.hidden-input)
  5x -0:14.7.0 core:backspace (input.hidden-input)

Non-Core Packages

atom-beautify 0.29.24 
autoclose-html 0.23.0 
autocomplete-paths 1.0.5 
busy-signal 1.4.1 
color-picker 2.2.5 
docblockr 0.9.4 
file-icons 2.1.6 
flex-tool-bar 0.12.0 
git-plus 7.8.1 
highlight-line 0.12.0 
highlight-selected 0.13.1 
intentions 1.1.2 
language-babel 2.61.0 
language-swift 0.5.0 
linter 2.1.4 
linter-csslint 1.3.4 
linter-htmlhint 1.3.3 
linter-javac 1.9.4 
linter-js-standard 3.9.1 
linter-jsonlint 1.3.0 
linter-phpmd 1.5.3 
linter-shellcheck 1.4.4 
linter-ui-default 1.5.4 
minimap 4.28.2 
minimap-highlight-selected 4.6.1 
minimap-pigments 0.2.2 
oceanic-next 1.0.0 
open-files 0.5.5 
pigments 0.39.1 
script 3.14.1 
set-syntax 0.3.2 
sort-lines 0.14.0 
sync-settings 0.8.1 
todo-show 1.11.0 
tool-bar 1.1.0 
tree-view-open-files 0.3.0 

Every time I drag a file to one half of the screen to split them, I get the error as soon as I change anything in that file. Even if I put them back in non-split mode, the error continues and I have to restart atom to stop it.

oriolmirosa commented 7 years ago

Thanks for the info, @J-Mills. I was able to reproduce and work on the bug. I think it should be fixed now in version 0.5.6, but please let me know if you're still encountering the problem

J-Mills commented 7 years ago

@oriolmirosa It's fixed!! Thank you. Everything seems to work fine now. Great package by the way - the only one I've found that actually works.