Pulsar-Edit-Highlights / selected

@Pulsar-Edit package for highlighting occurrences of your selection.

Home Page:https://web.pulsar-edit.dev/packages/highlight-selected

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uncaught TypeError: Cannot read property 'onDidDestroy' of undefined

vargas11 opened this issue · comments

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.28.1 x64
Electron: 2.0.4
OS: Mac OS X 10.13.4
Thrown From: highlight-selected package 0.14.0

Stack Trace

Uncaught TypeError: Cannot read property 'onDidDestroy' of undefined

At /Applications/Atom.app/Contents/Resources/app/src/layer-decoration.js:17

TypeError: Cannot read property 'onDidDestroy' of undefined
    at new LayerDecoration (/Applications/Atom.app/Contents/Resources/app/src/layer-decoration.js:17:68)
    at DecorationManager.decorateMarkerLayer (/Applications/Atom.app/Contents/Resources/app/src/decoration-manager.js:214:30)
    at TextEditor.decorateMarkerLayer (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:2317:41)
    at HighlightedAreaView.module.exports.HighlightedAreaView.highlightSelectionInEditor (/packages/highlight-selected/lib/highlighted-area-view.coffee:198:12)
    at /packages/highlight-selected/lib/highlighted-area-view.coffee:159:10
    at Array.forEach (<anonymous>)
    at HighlightedAreaView.module.exports.HighlightedAreaView.handleSelection (/packages/highlight-selected/lib/highlighted-area-view.coffee:158:27)
    at HighlightedAreaView.handleSelection (/packages/highlight-selected/lib/highlighted-area-view.coffee:1:1)
    at /packages/highlight-selected/lib/highlighted-area-view.coffee:88:8

Commands

     -1:17.9.0 core:paste (input.hidden-input)
     -1:17.5.0 editor:newline (input.hidden-input)
  3x -1:13.7.0 core:backspace (input.hidden-input)
     -1:08.6.0 snippets:previous-tab-stop (input.hidden-input)
     -1:08.6.0 editor:outdent-selected-rows (input.hidden-input)
     -0:43.7.0 core:paste (input.hidden-input)
     -0:41 snippets:next-tab-stop (input.hidden-input)
     -0:41 snippets:expand (input.hidden-input)
     -0:41 editor:indent (input.hidden-input)
     -0:38.2.0 core:save (input.hidden-input)
     -0:33 core:copy (input.hidden-input)
     -0:26.7.0 core:paste (input.hidden-input)
  2x -0:25.6.0 core:save (input.hidden-input)
     -0:06.1.0 core:undo (input.hidden-input)
  2x -0:03.5.0 core:backspace (input.hidden-input)
     -0:02.9.0 core:save (input.hidden-input)

Non-Core Packages

atom-beautify 0.32.5 
autoclose-html 0.23.0 
busy-signal 1.4.3 
highlight-selected 0.14.0 
intentions 1.1.5 
language-vue 0.23.1 
linter 2.2.0 
linter-htmlhint 1.4.0 
linter-php 1.5.1 
linter-ui-default 1.7.1 
minimap 4.29.8 
monokai-seti 0.9.0 
php-cs-fixer 4.1.1 
pigments 0.40.2 
project-viewer 1.3.1 
seti-icons 1.5.4 
seti-ui 1.10.0 

same
thanks to report

[Enter steps to reproduce:]

  1. use project-viewer to change project.
  2. select some word.

this seems to be a problem with project-viewer.
because , ctrl + f, search function either not work.

Closing as it seems it's an issue with project-viewer

I do not have project-viewer installed and still have the same issue.

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.28.2 x64
Electron: 2.0.5
OS: Ubuntu 16.04.4
Thrown From: highlight-selected package 0.14.0

Stack Trace

Uncaught TypeError: Cannot read property 'onDidDestroy' of undefined

At /usr/share/atom/resources/app/src/layer-decoration.js:17

TypeError: Cannot read property 'onDidDestroy' of undefined
    at new LayerDecoration (/usr/share/atom/resources/app/src/layer-decoration.js:17:68)
    at DecorationManager.decorateMarkerLayer (/usr/share/atom/resources/app/src/decoration-manager.js:214:30)
    at TextEditor.decorateMarkerLayer (/usr/share/atom/resources/app/src/text-editor.js:2317:41)
    at HighlightedAreaView.module.exports.HighlightedAreaView.highlightSelectionInEditor (/packages/highlight-selected/lib/highlighted-area-view.coffee:198:12)
    at /packages/highlight-selected/lib/highlighted-area-view.coffee:159:10
    at Array.forEach (<anonymous>)
    at HighlightedAreaView.module.exports.HighlightedAreaView.handleSelection (/packages/highlight-selected/lib/highlighted-area-view.coffee:158:27)
    at HighlightedAreaView.handleSelection (/packages/highlight-selected/lib/highlighted-area-view.coffee:1:1)
    at /packages/highlight-selected/lib/highlighted-area-view.coffee:88:8

Commands

     -3:06.3.0 core:paste (input.hidden-input)
     -3:04.3.0 core:delete (input.hidden-input)
     -3:02.9.0 editor:newline (input.hidden-input)
  4x -2:57.5.0 core:backspace (input.hidden-input)
     -2:50.5.0 markdown:link (input.hidden-input)
     -2:49.2.0 core:backspace (input.hidden-input)
     -2:47.6.0 core:move-down (input.hidden-input)
     -2:47.4.0 autocomplete-plus:confirm (input.hidden-input)
     -2:45.8.0 core:move-up (input.hidden-input)
     -2:45.5.0 editor:select-to-end-of-line (input.hidden-input)
     -2:44.9.0 core:copy (input.hidden-input)
     -2:44.4.0 core:move-down (input.hidden-input)
     -2:43.8.0 core:paste (input.hidden-input)
  2x -2:43.4.0 core:backspace (input.hidden-input)
     -2:41.5.0 core:save (input.hidden-input)
     -1:01.5.0 core:delete (input.hidden-input)

Non-Core Packages

asciidoc-preview 2.12.1 
atom-clock 0.1.16 
atom-material-ui 2.1.3 
autocomplete-clang 0.11.5 
autocomplete-paths 2.12.2 
autocomplete-python 1.10.5 
file-icons 2.1.22 
file-watcher 1.2.6 
graphviz-preview-plus 1.5.5 
highlight-selected 0.14.0 
Hydrogen 2.5.1 
hydrogen-launcher 1.2.2 
language-asciidoc 1.11.0 
language-docker 1.1.8 
language-dot 1.7.0 
language-latex 1.1.1 
language-markdown 0.26.0 
language-matlab 0.2.1 
language-todotxt 1.0.2 
latextools 0.8.5 
MagicPython 1.0.12 
markdown-scroll-sync 2.1.2 
minimap 4.29.8 
minimap-find-and-replace 4.5.2 
minimap-highlight-selected 4.6.1 
multi-cursor 2.1.5 
pdf-view 0.70.0 
platformio-ide-terminal 2.8.3 
project-manager 3.3.6 
sync-settings 0.8.6 

I also do not have project-viewer installed and have been experiencing this very same issue

Uncaught TypeError: Cannot read property 'onDidDestroy' of undefined
The error was thrown from the highlight-selected package. This issue has already been reported.

Atom: 1.28.2 x64
Electron: 2.0.5
OS: Mac OS X 10.13.2
Thrown From: highlight-selected package 0.14.0

steps to reproduce:

  1. double click on any given word
  2. error message will immediately prompt on screen

It's a problem with project-manager and project-viewer

Well... funny thing. I've uninstalled the project-manager package and the issue still persist :).

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.28.2 x64
Electron: 2.0.5
OS: Ubuntu 16.04.5
Thrown From: highlight-selected package 0.14.0

Stack Trace

Uncaught TypeError: Cannot read property 'onDidDestroy' of undefined

At /usr/share/atom/resources/app/src/layer-decoration.js:17

TypeError: Cannot read property 'onDidDestroy' of undefined
    at new LayerDecoration (/usr/share/atom/resources/app/src/layer-decoration.js:17:68)
    at DecorationManager.decorateMarkerLayer (/usr/share/atom/resources/app/src/decoration-manager.js:214:30)
    at TextEditor.decorateMarkerLayer (/usr/share/atom/resources/app/src/text-editor.js:2317:41)
    at HighlightedAreaView.module.exports.HighlightedAreaView.highlightSelectionInEditor (/packages/highlight-selected/lib/highlighted-area-view.coffee:198:12)
    at /packages/highlight-selected/lib/highlighted-area-view.coffee:159:10
    at Array.forEach (<anonymous>)
    at HighlightedAreaView.module.exports.HighlightedAreaView.handleSelection (/packages/highlight-selected/lib/highlighted-area-view.coffee:158:27)
    at HighlightedAreaView.handleSelection (/packages/highlight-selected/lib/highlighted-area-view.coffee:1:1)
    at /packages/highlight-selected/lib/highlighted-area-view.coffee:88:8

Commands

Non-Core Packages

asciidoc-preview 2.12.1 
atom-clock 0.1.16 
atom-material-ui 2.1.3 
autocomplete-clang 0.11.5 
autocomplete-paths 2.12.2 
autocomplete-python 1.10.5 
file-icons 2.1.22 
file-watcher 1.2.6 
graphviz-preview-plus 1.5.5 
highlight-selected 0.14.0 
Hydrogen 2.5.1 
hydrogen-launcher 1.2.2 
language-asciidoc 1.11.0 
language-docker 1.1.8 
language-dot 1.7.0 
language-latex 1.1.1 
language-markdown 0.26.0 
language-matlab 0.2.1 
language-todotxt 1.0.2 
latextools 0.8.5 
MagicPython 1.0.12 
markdown-scroll-sync 2.1.2 
minimap 4.29.8 
minimap-find-and-replace 4.5.2 
minimap-highlight-selected 4.6.1 
multi-cursor 2.1.5 
pdf-view 0.70.0 
platformio-ide-terminal 2.8.3 
sync-settings 0.8.6 

@Westflame after you uninstalled project-manager did you:

  1. Quit all panes/editors
  2. Quit all windows
  3. Quit Atom

or

Restart Atom leaving Panes/Windows/Editors open.

Or

Carry on without quitting Atom or closing Panes/Editors?

And I need steps to reproduce.

@richrace I've restarted Atom while leaving everything as it was.

Steps to reproduce are the same as @nubleon described. Just double click on any word.

Interesting... I also do not have project-manager and project-viewer installed, but have been experiencing this very same issue

[Enter steps to reproduce:]

  1. show the error message once double click any word...

Atom: 1.28.2 x64
Electron: 2.0.5
OS: Microsoft Windows 10 Pro
Thrown From: highlight-selected package 0.14.0

Stack Trace

Uncaught TypeError: Cannot read property 'onDidDestroy' of undefined

At C:\Users\marcus\AppData\Local\atom\app-1.28.2\resources\app\src\layer-decoration.js:17

TypeError: Cannot read property 'onDidDestroy' of undefined
    at new LayerDecoration (~/AppData/Local/atom/app-1.28.2/resources/app/src/layer-decoration.js:17:68)
    at DecorationManager.decorateMarkerLayer (~/AppData/Local/atom/app-1.28.2/resources/app/src/decoration-manager.js:214:30)
    at TextEditor.decorateMarkerLayer (~/AppData/Local/atom/app-1.28.2/resources/app/src/text-editor.js:2317:41)
    at HighlightedAreaView.module.exports.HighlightedAreaView.highlightSelectionInEditor (/packages/highlight-selected/lib/highlighted-area-view.coffee:198:12)
    at /packages/highlight-selected/lib/highlighted-area-view.coffee:159:10
    at Array.forEach (<anonymous>)
    at HighlightedAreaView.module.exports.HighlightedAreaView.handleSelection (/packages/highlight-selected/lib/highlighted-area-view.coffee:158:27)
    at HighlightedAreaView.handleSelection (/packages/highlight-selected/lib/highlighted-area-view.coffee:1:1)
    at /packages/highlight-selected/lib/highlighted-area-view.coffee:88:8

Commands

Non-Core Packages

color-picker 2.3.0 
cssnano 1.1.0 
file-icons 2.1.22 
highlight-selected 0.14.0 
language-nginx 0.8.0 
language-smarty 1.8.0 
language-twig 1.6.3 
minimap 4.29.8 

I'm still unable to replicate this issue so might need some help to confirm a fix or actually do the fix.

I don't have a computer to work on for a week, so bare with me.

I think it's a problem with the Map/Hash of Editors and it getting out of whack.

Probably lines:
https://github.com/richrace/highlight-selected/blob/master/lib/highlighted-area-view.coffee#L15-L26
https://github.com/richrace/highlight-selected/blob/master/lib/highlighted-area-view.coffee#L111-L117

commented

I was experiencing this on a single project-manager project. I'm not sure of the root cause but clearing the saved state (globally for all projects) seems to have fixed this for me.

commented

If you want to examine the state store for the current editor run this from the Atom DevTools console:

stateKey = atom.getStateKey(atom.getLoadSettings().initialPaths)
atom.stateStore.load(stateKey).then(r => console.log(r))
commented

I think this bug happens when you shift+click on a project in the project-manager list so it opens in the same window instead of a new one. Doing this seems to get the project into a corrupted state with highlight-selected.

For me, the issue only occurs when Atom opens with previous files, and the currently selected file is a README.

I do not have project-manager and project-viewer installed and have this issue. Highlight-selected has this bug inconsistently for me. Sometimes happens when I open a new file and sometimes it doesn't. Then if I switch to the tab it's choking on again it starts again.

Is there an easy way to revert to the previous version of highlight-selected? I've looked online and can't find an easy way to revert to older version of a package.

Here are my add-on packages:
atom-alignment, hyperclick, minimap, build, intentions, minimap-find-and-replace, busy, minimap-git-diff, busy-signal, language-diff, minimap-highlight-selected, file-icons, language-systemverilog, minimap-split-diff, file-watcher, language-tcl, revert-buffer, git-log, language-verilog, split-diff, git-plus, linter, Sublime-Style-Column-Selection, git-time-machine, linter-ui-default, sync-settings, highlight-selected, merge-conflicts, verilog-tools

Is it possible minimap-highlight-selected could conflict? Anyone else have this one?

@jdawgzim Should be something like apm install highlight-selected@0.13.1

@richrace I installed 0.13.1 and that fixed everything. Thank you. I have messed with it for a few minutes and so far I can't get this bug to happen.

I do not have project-manager or project-viewer installed for the issue and was having the issue. Updating to Atom 1.29.0 appears to have fixed the issue for me though, not seeing the errors anymore.

commented

@richrace the suggested apm install highlight-selected@0.13.1 seems to have fixed it for me too.

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.24.0 x64
Electron: 1.6.16
OS: Unknown Windows version
Thrown From: highlight-selected package 0.14.0

Stack Trace

Uncaught TypeError: Cannot read property 'onDidDestroy' of undefined

At C:\Users\Edward\AppData\Local\atom\app-1.24.0\resources\app\src\layer-decoration.js:17

TypeError: Cannot read property 'onDidDestroy' of undefined
    at new LayerDecoration (~/AppData/Local/atom/app-1.24.0/resources/app/src/layer-decoration.js:17:67)
    at DecorationManager.decorateMarkerLayer (~/AppData/Local/atom/app-1.24.0/resources/app/src/decoration-manager.js:214:30)
    at TextEditor.decorateMarkerLayer (~/AppData/Local/atom/app-1.24.0/resources/app/src/text-editor.js:2136:41)
    at HighlightedAreaView.module.exports.HighlightedAreaView.highlightSelectionInEditor (/packages/highlight-selected/lib/highlighted-area-view.coffee:198:12)
    at /packages/highlight-selected/lib/highlighted-area-view.coffee:159:10
    at Array.forEach (native)
    at HighlightedAreaView.module.exports.HighlightedAreaView.handleSelection (/packages/highlight-selected/lib/highlighted-area-view.coffee:158:27)
    at HighlightedAreaView.handleSelection (/packages/highlight-selected/lib/highlighted-area-view.coffee:1:1)
    at /packages/highlight-selected/lib/highlighted-area-view.coffee:88:8

Commands

  3x -5:20.4.0 core:move-up (input.hidden-input)
     -5:19 core:move-down (input.hidden-input)
     -5:18.4.0 core:confirm (input.hidden-input)
     -5:18.4.0 whitespace:remove-trailing-whitespace (input.hidden-input)
     -5:01.2.0 intentions:highlight (input.hidden-input)
     -5:01.1.0 core:select-all (input.hidden-input)
     -5:00.8.0 core:cut (input.hidden-input)
     -5:00.5.0 intentions:highlight (input.hidden-input)
     -5:00.3.0 core:paste (input.hidden-input)
     -3:46.6.0 intentions:highlight (input.hidden-input)
     -3:46 command-palette:toggle (input.hidden-input)
     -3:42.2.0 editor:consolidate-selections (input.hidden-input)
     -3:42.2.0 core:cancel (input.hidden-input)
     -3:41.4.0 command-palette:toggle (input.hidden-input)
     -3:39.1.0 core:confirm (input.hidden-input)
     -3:39.1.0 settings-view:open (input.hidden-input)

Non-Core Packages

atom-beautify 0.32.5 
busy-signal 1.4.3 
color-picker 2.3.0 
file-icons 2.1.22 
git-time-machine 2.1.0 
highlight-selected 0.14.0 
intentions 1.1.5 
linter 2.2.0 
linter-jshint 3.1.8 
linter-php 1.5.1 
linter-python 3.1.2 
linter-ui-default 1.7.1 
merge-conflicts 1.4.5 
minimap 4.29.8 
minimap-cursorline 0.2.0 
minimap-find-and-replace 4.5.2 
minimap-git-diff 4.3.1 
minimap-highlight-selected 4.6.1 
minimap-split-diff 0.3.7 
remote-ftp 2.2.0 
scroll-marker 0.2.0 
split-diff 1.5.2 
symbols-tree-view 0.14.0 
sync-settings 0.8.6 

@jtamlin I have no luck... After updating to Atom 1.29.0 still have the issue. And I do not have project-manager or project-viewer installed.

After that, I do the suggested apm install highlight-selected@0.13.1 seems to have fixed it for me too.