abe33/atom-color-highlight

Uncaught TypeError: Cannot read property 'displayBuffer' of null

bradpurchase opened this issue · 8 comments

[Enter steps to reproduce below:]

  1. Change theme/color scheme.
  2. View a file with hex colours
  3. Start typing.

Atom Version: 0.177.0
System: Mac OS X 10.10.2
Thrown From: atom-color-highlight package, v3.0.8

Stack Trace

Uncaught TypeError: Cannot read property 'displayBuffer' of null

At /Users/bradpurchase/.atom/packages/atom-color-highlight/lib/marker-mixin.coffee:56

TypeError: Cannot read property 'displayBuffer' of null
  at color-marker.module.exports.MarkerMixin.getScope (/Users/bradpurchase/.atom/packages/atom-color-highlight/lib/marker-mixin.coffee:56:8)
  at color-marker.module.exports.MarkerMixin.hiddenDueToComment (/Users/bradpurchase/.atom/packages/atom-color-highlight/lib/marker-mixin.coffee:67:14)
  at color-marker.module.exports.MarkerMixin.isHidden (/Users/bradpurchase/.atom/packages/atom-color-highlight/lib/marker-mixin.coffee:53:6)
  at color-marker.module.exports.MarkerMixin.show (/Users/bradpurchase/.atom/packages/atom-color-highlight/lib/marker-mixin.coffee:18:33)
  at atom-color-highlight.AtomColorHighlightElement.updateSelections (/Users/bradpurchase/.atom/packages/atom-color-highlight/lib/atom-color-highlight-element.coffee:82:10)
  at /Users/bradpurchase/.atom/packages/atom-color-highlight/lib/atom-color-highlight-element.coffee:59:8

Commands

     -2:57.5 core:cut (atom-text-editor.editor.autocomplete-active)
     -2:56.2 core:paste (atom-text-editor.editor.autocomplete-active)
     -2:55.9 core:save (atom-text-editor.editor.autocomplete-active)
     -2:19.9 core:backspace (atom-text-editor.editor.autocomplete-active)
     -2:19.7 core:save (atom-text-editor.editor.autocomplete-active)
     -1:17.1 fuzzy-finder:toggle-file-finder (atom-text-editor.editor.autocomplete-active)
  4x -1:15.9 core:move-down (atom-text-editor.editor.mini)
     -1:15.3 core:confirm (atom-text-editor.editor.mini)
     -1:14.7 settings-view:open (atom-text-editor.editor.autocomplete-active)
     -1:10.1 core:close (div.text.native-key-bindings)
  4x -0:32.4 editor:newline (atom-text-editor.editor.autocomplete-active)
     -0:26.8 core:backspace (atom-text-editor.editor.autocomplete-active)
  2x -0:25.5 core:save (atom-text-editor.editor.autocomplete-active)
     -0:10.8 fuzzy-finder:toggle-file-finder (atom-text-editor.editor.autocomplete-active)
     -0:10.0 core:confirm (atom-text-editor.editor.mini)
     -0:00.4 editor:newline (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "koala",
      "whitespace",
      "linter-rubocop",
      "linter-scss-lint"
    ],
    "themes": [
      "atom-light-ui",
      "atom-light-syntax"
    ]
  }
}

Installed Packages

# User
atom-color-highlight, v3.0.8
autocomplete-plus, v2.1.3
color-picker, v1.4.4
dash, v1.0.2
git-tab-status, v1.5.3
hipster-ipsum, v0.1.0
linter, v0.11.1
minimap, v4.1.3
project-manager, v1.15.5

# Dev
No dev packages

/cc @atom/core

Thanks for the report, I'm not sure why it fails like this, but I'll try to find the culprit.

I am running into the same problem when making changes to the "_settings.scss" file while working with Zurb Foundation. It is happening to me most of the time when I hit "Enter" to create a new line in any .scss file.

Here is my "config.cson" if that helps:

"*":
  editor:
    invisibles: {}
    fontSize: 12
  core:
    themes: [
      "seti-ui"
      "seti-syntax"
    ]
    disabledPackages: [
      "autocomplete"
      "highlight-line"
    ]
  "exception-reporting":
    userId: "fe09ace2-5aff-0322-bda5-9bc22d88eb4a"
  welcome:
    showOnStartup: false
  "linter-csslint": {}
  linter: {}
  "linter-htmlhint": {}
  "autocomplete-plus": {}
  "autoclose-html": {}
  autosave:
    enabled: true
  "linter-scss-lint":
    scssLintExecutablePath: "/usr/local/bin/scss-lint"
    scssLintExcludedLinters: [
      "Indentation"
    ]
  "project-palette-finder": {}
  "atom-color-highlight": {}
  "highlight-line": {}

Same issue here.

This happens constantly to me

This went away, but is back again today.

[Enter steps to reproduce below:]

  1. Started typing in SCSS file.

Atom Version: 0.194.0
System: Mac OS X 10.9.1
Thrown From: atom-color-highlight package, v3.0.9

Stack Trace

Uncaught TypeError: Cannot read property 'displayBuffer' of null

At /Users/cnc137/.atom/packages/atom-color-highlight/lib/marker-mixin.coffee:56

TypeError: Cannot read property 'displayBuffer' of null
  at color-marker.module.exports.MarkerMixin.getScope (/Users/cnc137/.atom/packages/atom-color-highlight/lib/marker-mixin.coffee:56:8)
  at color-marker.module.exports.MarkerMixin.hiddenDueToComment (/Users/cnc137/.atom/packages/atom-color-highlight/lib/marker-mixin.coffee:67:14)
  at color-marker.module.exports.MarkerMixin.isHidden (/Users/cnc137/.atom/packages/atom-color-highlight/lib/marker-mixin.coffee:53:6)
  at color-marker.module.exports.MarkerMixin.show (/Users/cnc137/.atom/packages/atom-color-highlight/lib/marker-mixin.coffee:18:33)
  at atom-color-highlight.AtomColorHighlightElement.updateSelections (/Users/cnc137/.atom/packages/atom-color-highlight/lib/atom-color-highlight-element.coffee:82:10)
  at /Users/cnc137/.atom/packages/atom-color-highlight/lib/atom-color-highlight-element.coffee:59:8

Commands

 33x -3:25.8.0 core:move-right (atom-text-editor.editor.is-focused.autocomplete-active)
     -3:22.4.0 editor:newline (atom-text-editor.editor.is-focused.autocomplete-active)
 37x -3:22.1.0 core:move-right (atom-text-editor.editor.is-focused.autocomplete-active)
     -3:18.1.0 editor:newline (atom-text-editor.editor.is-focused.autocomplete-active)
 29x -3:17.9.0 core:move-right (atom-text-editor.editor.is-focused.autocomplete-active)
     -3:14.6.0 editor:newline (atom-text-editor.editor.is-focused.autocomplete-active)
     -3:14.1.0 core:backspace (atom-text-editor.editor.is-focused.autocomplete-active)
     -3:07.1.0 core:copy (atom-text-editor.editor.is-focused.autocomplete-active)
     -3:05.1.0 core:paste (atom-text-editor.editor.is-focused.autocomplete-active)
  4x -3:01.3.0 core:delete (atom-text-editor.editor.is-focused.autocomplete-active)
     -2:50.7.0 core:save (atom-text-editor.editor.is-focused.autocomplete-active)
     -1:18.7.0 core:copy (atom-text-editor.editor.is-focused.autocomplete-active)
     -1:15.3.0 core:paste (atom-text-editor.editor.is-focused.autocomplete-active)
     -1:14 core:save (atom-text-editor.editor.is-focused.autocomplete-active)
     -0:19.3.0 editor:newline (atom-text-editor.editor.is-focused.autocomplete-active)
     -0:12 core:save (atom-text-editor.editor.is-focused.autocomplete-active)

Config

{
  "core": {
    "themes": [
      "seti-ui",
      "seti-syntax"
    ]
  },
  "atom-color-highlight": {}
}

Installed Packages

# User
atom-beautify, v0.24.1
atom-color-highlight, v3.0.9
autoclose-html, v0.15.0
autocomplete-css, v0.6.0
autocomplete-html, v0.6.0
autocomplete-paths, v1.0.2
autocomplete-plus, v2.12.1
linter, v0.12.1
linter-csslint, v0.0.11
linter-htmlhint, v0.0.13
linter-jshint, v0.1.2
linter-php, v0.0.12
linter-scss-lint, v0.0.14
project-palette-finder, v2.4.17
seti-syntax, v0.4.0
seti-ui, v0.6.3

# Dev
No dev packages
abe33 commented

I'll encourage all of you to migrate to pigments. It's a complete rewrite of this package but with a focus on performances and stability, which couldn't be really achieved with atom-color-highlight codebase.

atom-color-highlight is great, but there have definitely been performance issues. pigments looks really impressive. nice work !

abe33 commented

but there have definitely been performance issues

First implementation was too naive and wasn't really designed to handle really large files (ie. each change was destroying/recreating every color markers). Pigments on the contrary is designed to display and update only what's necessary, for instance the marker views used to display the colors are reused while you scroll, avoiding too much DOM manipulation.
There's still some performances issues in Pigments with really large project (1000+ variables), as I keep track of every variables, due to the frequent evaluation/conversion of these variables into colors. But I already have an idea on how to solve that, I just need the time to make the change and test it thoroughly.