abe33 / atom-pigments

An Atom package to display colors in project and files.
MIT License
521 stars 68 forks source link

Uncaught TypeError: Cannot read property 'NaN' of undefined (right-click) #377

Open jacekobst1 opened 6 years ago

jacekobst1 commented 6 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.23.3 x64 Electron: 1.6.15 OS: Microsoft Windows 10 Education Thrown From: pigments package 0.40.2

Stack Trace

Uncaught TypeError: Cannot read property 'NaN' of undefined

At C:\Users\jacek\AppData\Local\atom\app-1.23.3\resources\app\src\text-editor-component.js:959

TypeError: Cannot read property 'NaN' of undefined
    at TextEditorComponent.renderedScreenLineForRow (~/AppData/Local/atom/app-1.23.3/resources/app/src/text-editor-component.js:959:37)
    at TextEditorComponent.screenPositionForPixelPosition (~/AppData/Local/atom/app-1.23.3/resources/app/src/text-editor-component.js:2398:33)
    at HTMLElement.screenPositionForPixelPosition (/app.asar/src/text-editor-element.js:247:32)
    at HTMLElement.ColorBufferElement.screenPositionForMouseEvent (/packages/pigments/lib/color-buffer-element.coffee:429:22)
    at HTMLElement.ColorBufferElement.colorMarkerForMouseEvent (/packages/pigments/lib/color-buffer-element.coffee:415:17)
    at Object.colorMarkerForMouseEvent (/packages/pigments/lib/pigments.coffee:221:25)
    at Object.shouldDisplayContextMenu (/packages/pigments/lib/pigments.coffee:215:5)
    at /packages/pigments/lib/pigments.coffee:111:36)
    at ContextMenuManager.module.exports.ContextMenuManager.cloneItemForEvent (~/AppData/Local/atom/app-1.23.3/resources/app/src/context-menu-manager.js:167:25)
    at ContextMenuManager.module.exports.ContextMenuManager.templateForEvent (~/AppData/Local/atom/app-1.23.3/resources/app/src/context-menu-manager.js:100:39)
    at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (~/AppData/Local/atom/app-1.23.3/resources/app/src/context-menu-manager.js:189:33)
    at WindowEventHandler.handleDocumentContextmenu (~/AppData/Local/atom/app-1.23.3/resources/app/src/window-event-handler.js:251:44)

Commands

Non-Core Packages

atom-beautify 0.30.9 
atom-material-syntax 1.0.8 
atom-material-ui 2.1.1 
open-in-browser 0.5.2 
pigments 0.40.2 
sclarkso commented 6 years ago

[Enter steps to reproduce:]

  1. Right click anywhere in file being edited

Atom: 1.23.3 x64 Electron: 1.6.15 OS: Mac OS X 10.13.2 Thrown From: pigments package 0.40.2

Stack Trace

Uncaught TypeError: Cannot read property 'NaN' of undefined

At /Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:959

TypeError: Cannot read property 'NaN' of undefined
    at TextEditorComponent.renderedScreenLineForRow (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:959:37)
    at TextEditorComponent.screenPositionForPixelPosition (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:2398:33)
    at HTMLElement.screenPositionForPixelPosition (/Applications/Atom.app/Contents/Resources/app/src/text-editor-element.js:247:32)
    at HTMLElement.ColorBufferElement.screenPositionForMouseEvent (/packages/pigments/lib/color-buffer-element.coffee:429:22)
    at HTMLElement.ColorBufferElement.colorMarkerForMouseEvent (/packages/pigments/lib/color-buffer-element.coffee:415:17)
    at Object.colorMarkerForMouseEvent (/packages/pigments/lib/pigments.coffee:221:25)
    at Object.shouldDisplayContextMenu (/packages/pigments/lib/pigments.coffee:215:5)
    at /packages/pigments/lib/pigments.coffee:111:36)
    at ContextMenuManager.module.exports.ContextMenuManager.cloneItemForEvent (/Applications/Atom.app/Contents/Resources/app/src/context-menu-manager.js:167:25)
    at ContextMenuManager.module.exports.ContextMenuManager.templateForEvent (/Applications/Atom.app/Contents/Resources/app/src/context-menu-manager.js:100:39)
    at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (/Applications/Atom.app/Contents/Resources/app/src/context-menu-manager.js:189:33)
    at WindowEventHandler.handleDocumentContextmenu (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:251:44)

Commands

Non-Core Packages

atom-pair 2.0.13 
autocomplete-paths 2.12.2 
busy-signal 1.4.3 
file-icons 2.1.15 
git-plus 7.10.0 
git-time-machine 1.5.9 
intentions 1.1.5 
language-ansible 0.2.2 
linter 2.2.0 
linter-ansible-linting 1.3.1 
linter-js-yaml 1.2.8 
linter-jsonlint 1.3.0 
linter-ui-default 1.6.10 
markdown-preview-plus 2.4.16 
markdown-writer 2.7.3 
pigments 0.40.2 
plist-converter 0.2.0 
pretty-json 1.6.4 
project-plus 1.0.0 
project-view 0.6.2 
split-diff 1.5.2 
Sublime-Style-Column-Selection 1.7.4 
jacekobst1 commented 6 years ago

Right click anywhere in file is something that causes my problem. Yesterday when I enabled Pigments, issue just disappeared by itself.

jacekobst1 commented 6 years ago

Nope, it's still there, but only in PHP. I didn't checked it in nothing else except HTML, CSS, and PHP. In HTML and CSS it work fine.

rogerbinns commented 6 years ago

It is also there for python

tarikkavaz commented 6 years ago

also appears with scss files . I guess it has something to do with the package "pigments". I had to disabled it.

gsmetal commented 6 years ago

I got this in ruby file. Neighboring tab with another ruby file works good.

gsmetal commented 6 years ago

Atom restart didn't help. Disable of pigments package helped. Reopening file also helped.

pfftdammitchris commented 6 years ago

The error can go away if you empty the whole file until there is 0 characters remaining, save file, close tab, then open again and fill up the contents previously.

tianbis commented 6 years ago

I'm having this issue too, it pops up when right-clicking on a new, unsaved file. I didn't find this error when right-clicking any other saved file so far.

kucits commented 6 years ago

Issues with css, scss, CFML, html. Also color values are not being highlighted

[Enter steps to reproduce:]

  1. Open page
  2. right-click

Atom: 1.23.3 x64 Electron: 1.6.15 OS: Microsoft Windows 10 Enterprise Thrown From: pigments package 0.40.2

Stack Trace

Uncaught TypeError: Cannot read property 'NaN' of undefined

At \AppData\Local\atom\app-1.23.3\resources\app\src\text-editor-component.js:959

TypeError: Cannot read property 'NaN' of undefined
    at TextEditorComponent.renderedScreenLineForRow (~/AppData/Local/atom/app-1.23.3/resources/app/src/text-editor-component.js:959:37)
    at TextEditorComponent.screenPositionForPixelPosition (~/AppData/Local/atom/app-1.23.3/resources/app/src/text-editor-component.js:2398:33)
    at HTMLElement.screenPositionForPixelPosition (~/AppData/Local/atom/app-1.19.0/resources/app/src/text-editor-element.js:247:32)
    at HTMLElement.ColorBufferElement.screenPositionForMouseEvent (/packages/pigments/lib/color-buffer-element.coffee:429:22)
    at HTMLElement.ColorBufferElement.colorMarkerForMouseEvent (/packages/pigments/lib/color-buffer-element.coffee:415:17)
    at Object.colorMarkerForMouseEvent (/packages/pigments/lib/pigments.coffee:221:25)
    at Object.shouldDisplayContextMenu (/packages/pigments/lib/pigments.coffee:215:5)
    at /packages/pigments/lib/pigments.coffee:111:36)
    at ContextMenuManager.module.exports.ContextMenuManager.cloneItemForEvent (~/AppData/Local/atom/app-1.23.3/resources/app/src/context-menu-manager.js:167:25)
    at ContextMenuManager.module.exports.ContextMenuManager.templateForEvent (~/AppData/Local/atom/app-1.23.3/resources/app/src/context-menu-manager.js:100:39)
    at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (~/AppData/Local/atom/app-1.23.3/resources/app/src/context-menu-manager.js:189:33)
    at WindowEventHandler.handleDocumentContextmenu (~/AppData/Local/atom/app-1.23.3/resources/app/src/window-event-handler.js:251:44)

Commands

  2x -7:46.4.0 core:confirm (input.hidden-input)
     -4:32.8.0 core:backspace (input.hidden-input)
  3x -4:32.4.0 core:confirm (input.hidden-input)
     -1:34.2.0 color-picker:open (span.syntax--constant.syntax--other.syntax--color.syntax--rgb-value.syntax--hex.syntax--css)
     -1:26.4.0 core:undo (input.hidden-input)
     -1:21.7.0 color-picker:open (span.syntax--constant.syntax--other.syntax--color.syntax--rgb-value.syntax--hex.syntax--css)
     -1:19.2.0 editor:consolidate-selections (input.hidden-input)
     -1:19.2.0 atom-minify:close-panel (input.hidden-input)
     -1:19.2.0 core:cancel (input.hidden-input)
     -0:52.6.0 core:confirm (input.hidden-input)

Non-Core Packages

atom-beautify 0.30.9 
atom-material-syntax 1.0.8 
atom-material-ui 2.1.1 
atom-minify 0.8.0 
gulp-task-launcher 1.4.13 
language-coldfusion 0.1.0 
language-lucee 0.2.0 
open-on-bitbucket 0.5.0 
pigments 0.40.2 
remote-ftp 2.1.4 
sass-autocompile 0.13.5 
mistergraphx commented 6 years ago

Hi same issue with a gulpfile.js, closing the file and re-open it solved the problem…

there is no colors informations in this file, if it can help …

Salamafet commented 6 years ago

Bonjour, Same bug with a simple little txt. Closing and re opening file solved the problem.

sebastianflemming commented 6 years ago

Also with JavaScript

[Enter steps to reproduce:]

  1. Right click anywhere in file

Atom: 1.24.0 x64 Electron: 1.6.16 OS: Microsoft Windows 10 Pro Thrown From: pigments package 0.40.2

Stack Trace

Uncaught TypeError: Cannot read property 'NaN' of undefined

At C:\Users\user1\AppData\Local\atom\app-1.24.0\resources\app\src\text-editor-component.js:963

TypeError: Cannot read property 'NaN' of undefined
    at TextEditorComponent.renderedScreenLineForRow (~/AppData/Local/atom/app-1.24.0/resources/app/src/text-editor-component.js:963:37)
    at TextEditorComponent.screenPositionForPixelPosition (~/AppData/Local/atom/app-1.24.0/resources/app/src/text-editor-component.js:2399:33)
    at HTMLElement.screenPositionForPixelPosition (/app.asar/src/text-editor-element.js:250:32)
    at HTMLElement.ColorBufferElement.screenPositionForMouseEvent (/packages/pigments/lib/color-buffer-element.coffee:429:22)
    at HTMLElement.ColorBufferElement.colorMarkerForMouseEvent (/packages/pigments/lib/color-buffer-element.coffee:415:17)
    at Object.colorMarkerForMouseEvent (/packages/pigments/lib/pigments.coffee:221:25)
    at Object.shouldDisplayContextMenu (/packages/pigments/lib/pigments.coffee:215:5)
    at /packages/pigments/lib/pigments.coffee:111:36)
    at ContextMenuManager.module.exports.ContextMenuManager.cloneItemForEvent (~/AppData/Local/atom/app-1.24.0/resources/app/src/context-menu-manager.js:167:25)
    at ContextMenuManager.module.exports.ContextMenuManager.templateForEvent (~/AppData/Local/atom/app-1.24.0/resources/app/src/context-menu-manager.js:100:39)
    at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (~/AppData/Local/atom/app-1.24.0/resources/app/src/context-menu-manager.js:189:33)
    at WindowEventHandler.handleDocumentContextmenu (~/AppData/Local/atom/app-1.24.0/resources/app/src/window-event-handler.js:251:44)

Commands

  3x -2:16.6.0 atom-beautify:beautify-editor (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)

Non-Core Packages

atom-beautify 0.32.0 
atom-jest-snippets 2.0.0 
atom-ternjs 0.18.3 
atom-transpose 0.3.5 
atom-wrap-in-tag 0.6.0 
autoclose-html 0.23.0 
autocomplete-modules 1.11.0 
busy-signal 1.4.3 
case-keep-replace 0.6.1 
change-case 0.6.5 
color-picker 2.2.5 
copy-path 0.5.1 
docblockr 0.13.7 
dracula-syntax 2.0.6 
duplicate-line-or-selection 0.9.0 
editorconfig 2.2.2 
emmet 2.4.3 
emmet-jsx-css-modules 1.0.0 
es6-javascript 1.0.0 
file-icons 2.1.17 
git-plus 7.10.0 
highlight-selected 0.13.1 
hyperclick 0.1.5 
intentions 1.1.5 
js-hyperclick 1.13.0 
language-babel 2.84.0 
linter 2.0.0 
linter-eslint 8.4.1 
linter-ui-default 1.7.1 
local-history 4.3.1 
lodash-snippets 2.0.0 
pigments 0.40.2 
prettier-atom 0.51.0 
project-manager 3.3.5 
react-es7-snippets 0.3.13 
related 0.3.5 
set-syntax 0.4.0 
sort-lines 0.18.0 
Sublime-Style-Column-Selection 1.7.4 
sync-settings 0.8.5 
tab-foldername-index 3.3.0 
toggle-quotes 1.1.0 
tree-view-copy-relative-path 1.2.0 
SeriousMarc commented 6 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.24.0 x64 Electron: 1.6.16 OS: Microsoft Windows 10 Pro Thrown From: pigments package 0.40.2

Stack Trace

Uncaught TypeError: Cannot read property 'NaN' of undefined

At C:\Users\User\AppData\Local\atom\app-1.24.0\resources\app\src\text-editor-component.js:963

TypeError: Cannot read property 'NaN' of undefined
    at TextEditorComponent.renderedScreenLineForRow (~/AppData/Local/atom/app-1.24.0/resources/app/src/text-editor-component.js:963:37)
    at TextEditorComponent.screenPositionForPixelPosition (~/AppData/Local/atom/app-1.24.0/resources/app/src/text-editor-component.js:2399:33)
    at HTMLElement.screenPositionForPixelPosition (/app.asar/src/text-editor-element.js:250:32)
    at HTMLElement.ColorBufferElement.screenPositionForMouseEvent (/packages/pigments/lib/color-buffer-element.coffee:429:22)
    at HTMLElement.ColorBufferElement.colorMarkerForMouseEvent (/packages/pigments/lib/color-buffer-element.coffee:415:17)
    at Object.colorMarkerForMouseEvent (/packages/pigments/lib/pigments.coffee:221:25)
    at Object.shouldDisplayContextMenu (/packages/pigments/lib/pigments.coffee:215:5)
    at /packages/pigments/lib/pigments.coffee:111:36)
    at ContextMenuManager.module.exports.ContextMenuManager.cloneItemForEvent (~/AppData/Local/atom/app-1.24.0/resources/app/src/context-menu-manager.js:167:25)
    at ContextMenuManager.module.exports.ContextMenuManager.templateForEvent (~/AppData/Local/atom/app-1.24.0/resources/app/src/context-menu-manager.js:100:39)
    at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (~/AppData/Local/atom/app-1.24.0/resources/app/src/context-menu-manager.js:189:33)
    at WindowEventHandler.handleDocumentContextmenu (~/AppData/Local/atom/app-1.24.0/resources/app/src/window-event-handler.js:251:44)

Commands

Non-Core Packages

ask-stack 2.2.0 
atom-beautify 0.30.9 
atom-live-server 2.2.0 
busy-signal 1.4.3 
color-picker 2.2.5 
emmet 2.4.3 
file-icons 2.1.16 
fonts 3.0.3 
git-plus 7.10.0 
highlight-selected 0.13.1 
intentions 1.1.5 
linter 2.2.0 
linter-ui-default 1.6.10 
minimap 4.29.7 
pigments 0.40.2 
todo 0.6.0 
giorgiobeggiora commented 6 years ago

[Enter steps to reproduce:]

  1. right click in some file
  2. ...

Atom: 1.24.1 x64 Electron: 1.6.16 OS: Mac OS X 10.12.6 Thrown From: pigments package 0.40.2

Stack Trace

Uncaught TypeError: Cannot read property 'NaN' of undefined

At /Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:963

TypeError: Cannot read property 'NaN' of undefined
    at TextEditorComponent.renderedScreenLineForRow (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:963:37)
    at TextEditorComponent.screenPositionForPixelPosition (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:2399:33)
    at HTMLElement.screenPositionForPixelPosition (/app.asar/src/text-editor-element.js:250:32)
    at HTMLElement.ColorBufferElement.screenPositionForMouseEvent (/packages/pigments/lib/color-buffer-element.coffee:429:22)
    at HTMLElement.ColorBufferElement.colorMarkerForMouseEvent (/packages/pigments/lib/color-buffer-element.coffee:415:17)
    at Object.colorMarkerForMouseEvent (/packages/pigments/lib/pigments.coffee:221:25)
    at Object.shouldDisplayContextMenu (/packages/pigments/lib/pigments.coffee:215:5)
    at /packages/pigments/lib/pigments.coffee:111:36)
    at ContextMenuManager.module.exports.ContextMenuManager.cloneItemForEvent (/Applications/Atom.app/Contents/Resources/app/src/context-menu-manager.js:167:25)
    at ContextMenuManager.module.exports.ContextMenuManager.templateForEvent (/Applications/Atom.app/Contents/Resources/app/src/context-menu-manager.js:100:39)
    at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (/Applications/Atom.app/Contents/Resources/app/src/context-menu-manager.js:189:33)
    at WindowEventHandler.handleDocumentContextmenu (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:251:44)

Commands

     -0:57.1.0 fav:ae64-utils (input.hidden-input)

Non-Core Packages

advanced-open-file 0.16.8 
api-docs 0.0.6 
atom-beautify 0.32.2 
atom-easy-jsdoc 4.12.5 
atom-ide-ui 0.9.3 
atom-typescript 12.3.7 
auto-update-packages 1.0.1 
autoclose-html 0.23.0 
autocomplete-modules 1.12.0 
autocomplete-paths 2.12.2 
busy-signal 1.4.3 
color-picker 2.2.5 
ctrl-dir-scroll 0.2.5 
docblockr 0.13.7 
double-tag 1.1.0 
expand-region 0.4.0 
favorites 0.4.0 
file-icons 2.1.17 
foldername-tabs 0.2.4 
git-time-machine 1.5.9 
goto-definition 1.3.4 
highlight-selected 0.13.1 
ide-php 0.7.9 
ide-typescript 0.7.5 
intentions 1.1.5 
jsdoc-preview 1.2.1 
keyboard-scroll 0.7.0 
language-pug 0.0.22 
linter 2.2.0 
linter-ui-default 1.7.1 
markdown-scroll-sync 2.1.2 
minimap 4.29.8 
minimap-highlight-selected 4.6.1 
multi-cursor-plus 1.2.0 
one-theme-color-by-project 2.0.0 
open-in-browsers 0.0.30 
open-recent 5.0.0 
open-terminal-here 2.3.1 
pigments 0.40.2 
platformio-ide-terminal 2.8.0 
project-manager 3.3.5 
simple-align 0.2.0 
simple-drag-drop-text 0.4.0 
split-selection-into-cursors 0.2.0 
switch-quotes 0.1.0 
todo-show 2.2.0 
tree-view-search-bar 1.0.2 
vertical-tabs 1.0.7 
webbox-color 0.5.9 
missmatsuko commented 6 years ago

This happens to me when I left-click.

intrepidocabral commented 6 years ago

same bad behavior here.

[Enter steps to reproduce]

  1. open a .css file
  2. right mouse click

Atom: 1.24.1 x64 OS: Debian 9 Thrown From: pigments package 0.40.2

Uncaught TypeError: Cannot read property 'NaN' of undefined

.../src/text-editor-component.js:963

TypeError: Cannot read property 'NaN' of undefined
    at TextEditorComponent.renderedScreenLineForRow (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:963:37)
    at TextEditorComponent.screenPositionForPixelPosition (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:2399:33)
    at HTMLElement.screenPositionForPixelPosition (/app.asar/src/text-editor-element.js:250:32)
    at HTMLElement.ColorBufferElement.screenPositionForMouseEvent (/packages/pigments/lib/color-buffer-element.coffee:429:22)
    at HTMLElement.ColorBufferElement.colorMarkerForMouseEvent (/packages/pigments/lib/color-buffer-element.coffee:415:17)
    at Object.colorMarkerForMouseEvent (/packages/pigments/lib/pigments.coffee:221:25)
    at Object.shouldDisplayContextMenu (/packages/pigments/lib/pigments.coffee:215:5)
    at /packages/pigments/lib/pigments.coffee:111:36)
    at ContextMenuManager.module.exports.ContextMenuManager.cloneItemForEvent (/Applications/Atom.app/Contents/Resources/app/src/context-menu-manager.js:167:25)
    at ContextMenuManager.module.exports.ContextMenuManager.templateForEvent (/Applications/Atom.app/Contents/Resources/app/src/context-menu-manager.js:100:39)
    at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (/Applications/Atom.app/Contents/Resources/app/src/context-menu-manager.js:189:33)
    at WindowEventHandler.handleDocumentContextmenu (/Applications/Atom.app/Content
ghost commented 6 years ago

same same thing for me with js files

trandaison commented 5 years ago

The same here for me with .vue (single component) file. The file conatains template, style and scripts.

Enter steps to reproduce

Atom: 1.33.1 x64 OS: MacOSX 10.12.6 Thrown From: pigments package 0.40.2