minimap: Uncaught TypeError: Cannot read property 'pixelPositionForScreenPosition' of null

[Enter steps to reproduce below:]

  1. Opened a makefile in a panel and a .ts file in a different panel
  2. Closed the .ts file without deleting the panel

Atom Version: 1.7.4 System: Mac OS X 10.11.5 Thrown From: minimap package, v4.24.2

Stack Trace

Uncaught TypeError: Cannot read property ‘pixelPositionForScreenPosition’ of null

At /Applications/Atom.app/Contents/Resources/app.asar/src/text-editor-element.js:336

TypeError: Cannot read property 'pixelPositionForScreenPosition' of null
    at atom-text-editor.TextEditorElement.pixelPositionForScreenPosition (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor-element.js:336:28)
    at StableAdapter.computeScrollTop (/Users/jpcf/.atom/packages/minimap/lib/adapters/stable-adapter.js:54:42)
    at StableAdapter.getScrollTop (/Users/jpcf/.atom/packages/minimap/lib/adapters/stable-adapter.js:47:17)
    at Minimap.getTextEditorScrollRatio (/Users/jpcf/.atom/packages/minimap/lib/minimap.js:519:25)
    at Minimap.getCapedTextEditorScrollRatio (/Users/jpcf/.atom/packages/minimap/lib/minimap.js:531:29)
    at Minimap.getScrollTopFromEditor (/Users/jpcf/.atom/packages/minimap/lib/minimap.js:852:12)
    at Minimap.getScrollTop (/Users/jpcf/.atom/packages/minimap/lib/minimap.js:806:14)
    at Minimap.getLastVisibleScreenRow (/Users/jpcf/.atom/packages/minimap/lib/minimap.js:784:13)
    at Minimap.emitRangeChanges (/Users/jpcf/.atom/packages/minimap/lib/mixins/decoration-management.js:497:38)
    at Minimap.emitDecorationChanges (/Users/jpcf/.atom/packages/minimap/lib/mixins/decoration-management.js:482:10)
    at Minimap.removeAllDecorationsForMarker (/Users/jpcf/.atom/packages/minimap/lib/mixins/decoration-management.js:575:12)
    at /Users/jpcf/.atom/packages/minimap/lib/mixins/decoration-management.js:349:14
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at TextEditorMarker.module.exports.TextEditorMarker.destroyed (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor-marker.js:229:20)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/text-editor-marker.js:37:24
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at Marker.module.exports.Marker.destroy (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/marker.js:252:27)
    at TextEditorMarker.module.exports.TextEditorMarker.destroy (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor-marker.js:43:25)
    at MinimapHighlightSelectedView.module.exports.HighlightedAreaView.removeMarkers (/Users/jpcf/.atom/packages/highlight-selected/lib/highlighted-area-view.coffee:152:12)
    at MinimapHighlightSelectedView.removeMarkers (/Users/jpcf/.atom/packages/highlight-selected/lib/highlighted-area-view.coffee:1:1)
    at MinimapHighlightSelectedView.handleSelection (/Users/jpcf/.atom/packages/minimap-highlight-selected/lib/minimap-highlight-selected-view.coffee:38:8)
    at MinimapHighlightSelectedView.handleSelection (/Users/jpcf/.atom/packages/highlight-selected/lib/highlighted-area-view.coffee:1:1)
    at MinimapHighlightSelectedView.subscribeToActiveTextEditor (/Users/jpcf/.atom/packages/minimap-highlight-selected/lib/minimap-highlight-selected-view.coffee:96:8)
    at /Users/jpcf/.atom/packages/highlight-selected/lib/highlighted-area-view.coffee:15:8
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/pane-container.js:346:27
    at Pane.module.exports.Pane.observeActiveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:223:7)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/pane-container.js:344:42
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at PaneContainer.module.exports.PaneContainer.setActivePane (/Applications/Atom.app/Contents/Resources/app.asar/src/pane-container.js:196:22)
    at Pane.module.exports.Pane.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:807:15)
    at PaneContainer.module.exports.PaneContainer.activateNextPane (/Applications/Atom.app/Contents/Resources/app.asar/src/pane-container.js:250:26)

Commands

     -1:46 editor:newline (atom-text-editor.editor.is-focused)
     -1:42.6.0 core:move-up (atom-text-editor.editor.is-focused)
     -1:42.1.0 editor:newline (atom-text-editor.editor.is-focused)
     -1:40.3.0 core:backspace (atom-text-editor.editor.is-focused)
     -1:34.7.0 core:copy (atom-text-editor.editor.is-focused)
     -1:33.4.0 core:paste (atom-text-editor.editor.is-focused)
     -1:31.6.0 core:move-left (atom-text-editor.editor.is-focused)
 26x -1:31.3.0 editor:select-to-beginning-of-word (atom-text-editor.editor.is-focused)
  6x -1:28.5.0 editor:select-to-end-of-word (atom-text-editor.editor.is-focused)
     -1:26.3.0 editor:select-to-beginning-of-word (atom-text-editor.editor.is-focused)
     -1:21.5.0 core:move-right (atom-text-editor.editor.is-focused)
 19x -1:21.1.0 editor:select-to-end-of-word (atom-text-editor.editor.is-focused)
     -1:17.3.0 core:backspace (atom-text-editor.editor.is-focused)
     -1:11.2.0 core:save (atom-text-editor.editor.is-focused)
     -1:09.9.0 editor:move-to-first-character-of-line (atom-text-editor.editor.is-focused)
     -1:09.2.0 editor:newline (atom-text-editor.editor.is-focused)

Config

{
  "minimap": {
    "plugins": {
      "highlight-selected": true,
      "highlight-selectedDecorationsZIndex": 0
    }
  }
}

Installed Packages

# User
atom-beautify, v0.29.7
atom-typescript, v8.10.2
auto-detect-indentation, v1.0.0
highlight-line, v0.11.1
highlight-selected, v0.11.2
json-colorer, v0.3.0
language-latex, v0.6.1
last-cursor-position, v0.9.0
latexer, v0.3.0
linter, v1.11.4
minimap, v4.24.2
minimap-highlight-selected, v4.4.0
pretty-json, v1.4.0
terminal-plus, v0.14.5

# Dev
No dev packages

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 14
  • Comments: 33 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Got this after install project-plus, always happen when switching projects.

  1. Switch projects using project-plus package

Atom Version: 1.7.3 System: Ubuntu 16.04.1

Installed Packages

# User
activate-power-mode@0.7.4
atom-beautify@0.29.10
column-select@0.2.0
file-icons@1.7.18
highlight-selected@0.11.2
increment-me@0.3.0
language-javascript-jsx@0.3.7
linter@1.11.16
minimap@4.24.7
minimap-git-diff@4.3.1
minimap-highlight-selected@4.4.0
pigments@0.31.2
project-plus@0.9.0

I have same problem with project-viewer. It appear when switching project, but only if the file in the current tab of the loaded project, had some git modification.

Last Atom version and last packages version

Could we just add a quick hack on the text-editor-element.coffee:209 for null check, and resolve the root cause later? The notifications are kind of annoying, as it causes no trouble on usage~~~

More info: Inside this function pixelPositionForScreenPosition: (screenPosition) -> ...

Just to show how annoying it is: image

The error persist on switching tabs with project-plus or project-viewer It happens when a tab is in those cases and switched :

  • Code selected or highlight-selected
  • Something searched
  • Code différence with git (modified, added, removed)
  • (probaly also with linter and pigments)

Nothing happens if minimap is clear.

I have the same problem and use sort of the same approach as @Yajo, but using project-viewer

Versions apm 1.12.9 npm 3.10.5 node 4.4.5 python git 2.8.0.windows.1 visual studio 2015

Custom packages installed: atom-autocomplete-php@0.20.2 atom-beautify@0.29.14 atom-react-native-autocomplete@0.0.27 atom-typescript@10.1.13 autoclose-html@0.23.0 babel-react-syntax@1.2.0 blame@0.10.2 color-picker@2.2.3 custom-title@1.0.1 docblock-format-helper@0.3.0 docblockr@0.9.1 double-click-tree-view@1.1.0 emmet@2.4.3 emmet-snippets-compatibility@1.0.6 es-identifier-highlight@0.4.3 file-icons@1.7.25 imdone-atom@2.0.20 js-refactor@0.7.4 language-apache@1.7.0 language-babel@2.48.5 language-generic-config@1.3.0 language-javascript-jsx@0.3.7 language-stylus@0.2.0 linter@1.11.18 linter-eslint@8.0.0 linter-htmlhint@1.3.1 linter-js-yaml@1.2.6 linter-json-lint@0.1.1 linter-php@1.3.1 linter-phpcs@1.5.5 minimap@4.25.7 minimap-cursorline@0.2.0 minimap-find-and-replace@4.5.1 minimap-highlight-selected@4.4.0 minimap-linter@1.6.0 minimap-pigments@0.2.2 minimap-selection@4.4.0 navigate@0.1.17 php-cs-fixer@4.1.0 php-hyperclick@1.2.1 php-twig@4.0.0 pigments@0.37.0 project-viewer@0.3.42 refactor@0.11.3 seti-ui@1.4.0 Sublime-Style-Column-Selection@1.7.2 tabs-to-spaces@1.0.2 turbo-javascript@1.4.0

  1. Install project-plus.
  2. Open Atom within a project.
  3. Switch to another project.
  4. Switch back to 1st project.

My env details here: https://github.com/atom-minimap/minimap/issues/489#issuecomment-268502218

my temporary “fix”

atom-notification.fatal {
  opacity: 0;
  pointer-events: none;
}

😈