abe33 / atom-pigments

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

Uncaught TypeError: this.editor.displayBuffer.getVisibleRowRange is not a function #92

Closed lee-dohm closed 9 years ago

lee-dohm commented 9 years ago

[Enter steps to reproduce below:]

  1. Open a file
  2. Attempt to scroll it

Atom Version: 1.2.0-dev-daca18f System: Mac OS X 10.10.5 Thrown From: pigments package, v0.15.0

Stack Trace

Uncaught TypeError: this.editor.displayBuffer.getVisibleRowRange is not a function

At /Users/Lee/.atom/packages/pigments/lib/color-buffer-element.coffee:138

TypeError: this.editor.displayBuffer.getVisibleRowRange is not a function
    at pigments-markers.ColorBufferElement.updateMarkers (/Users/Lee/.atom/packages/pigments/lib/color-buffer-element.coffee:138:55)
    at /Users/Lee/.atom/packages/pigments/lib/color-buffer-element.coffee:48:8
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
    at TextEditorPresenter.module.exports.TextEditorPresenter.commitPendingScrollTopPosition (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor-presenter.js:2009:22)
    at TextEditorPresenter.module.exports.TextEditorPresenter.updateScrollPosition (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor-presenter.js:2031:19)
    at TextEditorPresenter.module.exports.TextEditorPresenter.getState (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor-presenter.js:98:12)
    at TextEditorComponent.module.exports.TextEditorComponent.updateSync (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor-component.js:194:38)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/text-editor-component.js:302:28
    at ViewRegistry.module.exports.ViewRegistry.performDocumentUpdate (/Applications/Atom.app/Contents/Resources/app.asar/src/view-registry.js:174:9)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/view-registry.js:3:61

Commands

Config

{
  "core": {
    "followSymlinks": true,
    "projectHome": "/Users/Lee/Source",
    "ignoredNames": [
      ".git",
      ".hg",
      ".svn",
      ".DS_Store",
      ".keep",
      "._*",
      "*.pyc",
      "Thumbs.db"
    ],
    "themes": [
      "one-light-ui",
      "one-light-syntax"
    ],
    "audioBeep": false
  },
  "pigments": {}
}

Installed Packages

# User
asciidoc-preview, v0.6.0
autocomplete-elixir, v1.3.12
autocomplete-emojis, v2.2.2
block-travel, v1.0.2
bug-report, v0.7.1
file-type-icons, v0.7.3
indentation-indicator, v0.6.0
language-asciidoc, v0.12.0
language-elixir, v0.5.2
language-generic-config, v0.2.0
language-haml, v0.21.0
language-todotxt, v0.6.1
minimap, v4.13.3
minimap-find-and-replace, v4.3.0
pigments, v0.15.0
red-wavy-underline, v0.3.0
regex-railroad-diagram, v0.10.3
set-syntax, v0.3.0
soft-wrap-indicator, v0.7.0
tabs-to-spaces, v0.11.1

# Dev
No dev packages
abe33 commented 9 years ago

Hi @lee-dohm, I discovered that this morning, 0.16.0 addresses this issue, I just forgot to link the commit to your issue.

lee-dohm commented 9 years ago

Awesome, thanks!

langtianlang commented 9 years ago

Seeing this exception on v0.18.1. Different stack trace though, so I wasn't sure whether I should open a new issue.

[Enter steps to reproduce below:]

  1. open any file

Atom Version: 1.1.0 System: Mac OS X 10.10.4 Thrown From: pigments package, v0.18.1

Stack Trace

Uncaught TypeError: this.editor.displayBuffer.getVisibleRowRange is not a function

At /Users/llang/.atom/packages/pigments/lib/color-buffer-element.coffee:217

TypeError: this.editor.displayBuffer.getVisibleRowRange is not a function
  at pigments-markers.ColorBufferElement.updateMarkers (/Users/llang/.atom/packages/pigments/lib/color-buffer-element.coffee:115:55)
  at pigments-markers.ColorBufferElement.attachedCallback (/Users/llang/.atom/packages/pigments/lib/color-buffer-element.coffee:24:6)
  at atom-pane.PaneElement.activeItemChanged (/Applications/Atom.app/Contents/Resources/app.asar/src/pane-element.js:131:24)
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:86:11)
  at Pane.module.exports.Pane.setActiveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:247:22)
  at Pane.module.exports.Pane.activateItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:311:21)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:474:16
  at process._tickCallback (node.js:365:9)

Commands

     -1:52.4.0 settings-view:check-for-package-updates (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-monokai.theme-atom-dark-ui)
     -0:57.3.0 tabs:close-all-tabs (div.title)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "monokai"
    ],
    "projectHome": "/Users/llang/code",
    "disabledPackages": [
      "autocomplete-atom-api",
      "atom-color-highlight"
    ],
    "audioBeep": false
  }
}

Installed Packages

# User
color-picker, v2.0.13
linter, v1.9.1
monokai, v0.18.0
pigments, v0.18.1
vim-mode, v0.62.0

# Dev
No dev packages
abe33 commented 9 years ago

@langtianlang Looks like another issue with custom elements not updated with the rest of the package.

In Pigments 0.18.1 the line referenced in your stack trace should be this one: https://github.com/abe33/atom-pigments/blob/master/lib/color-buffer-element.coffee#L145

But it's the previous version, reloading Atom should fix that.

kiki-le-singe commented 9 years ago

@abe33 Thanks!

langtianlang commented 9 years ago

@abe33 excellent thanks

abe33 commented 9 years ago

Glad to hear that :-)

FWIW, I'm currently considering getting rid of the custom elements, it's just too much trouble given every update can possibly break something without being able to do anything except reload Atom. And forcing a reload is clearly a poor UX. I'll probably work on that after I shipped the new services allowing to extend Pigments colors and variables parsing.

johnrlive commented 8 years ago

I reinstalled pigments plugin by typing this in terminal: 'apm install pigments' Then I restarted Atom and it worked.

nynhex commented 8 years ago

@johnrlive I did the same thing and it worked for me. Thanks for posting.

grantmnelson commented 8 years ago

I encountered this error for the first time today (10 Nov '15) and was directed here when I clicked "this issue has already been reported." @johnrlive's fix solved it for me.

ccoenen commented 8 years ago

Funnily, this issue bit me after the update to atom 1.2 (on windows). For some reason, pigments was stuck at 0.15 on my machine. And it appears to have been broken in a way that i couldn't open settings. Updating from command line worked just fine. Just mentioning this, in case anyone else runs into this problem:

C:\Users\user> apm update pigments
Package Updates Available (1)
└── pigments 0.15.0 -> 0.18.1

Would you like to install these updates? (yes) yes

Installing pigments@0.18.1 to C:\Users\user\.atom\packages done
abe33 commented 8 years ago

Glad to hear that it works again for you, starting with the next version Pigments will be using a new trick to allow updates of custom elements, so with later updates this kind of thing should no longer appear (as long as there's no change in Atom API that breaks Pigments).