adrianlee44 / atom-aligner

Easily align multi-line with support for different operators and custom configurations
https://atom.io/packages/aligner
MIT License
78 stars 3 forks source link

Uncaught TypeError: Cannot read property 'getSelectedBufferRanges' of undefined #69

Closed kravlost closed 7 years ago

kravlost commented 7 years ago
  1. install keybindings-cheatsheet
  2. install atom-aligner
  3. Press Ctrl+Alt+/ once - the keybindings pane opens
  4. Press Ctrl+Alt+/ again - the error occurs

Both packages use the same shortcut, and it seems that atom-aligner doesn't like being triggered from within the keybindings-cheatsheet pane.

Atom: 1.17.2 x64 Electron: 1.3.15 OS: Microsoft Windows 10 Pro Thrown From: aligner package 1.2.1

Stack Trace

Uncaught TypeError: Cannot read property 'getSelectedBufferRanges' of undefined

At C:\Users\steronydh\.atom\packages\aligner\lib\main.js:22

TypeError: Cannot read property 'getSelectedBufferRanges' of undefined
    at Aligner.align (/packages/aligner/lib/main.js:22:11)
    at /packages/aligner/lib/main.js:71:12)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (~/AppData/Local/atom/app-1.17.2/resources/app/src/command-registry.js:265:1)
    at ~/AppData/Local/atom/app-1.17.2/resources/app/src/command-registry.js:3:1
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (~/AppData/Local/atom/app-1.17.2/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:610:1)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (~/AppData/Local/atom/app-1.17.2/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:401:1)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (~/AppData/Local/atom/app-1.17.2/resources/app/src/window-event-handler.js:100:1)
    at HTMLDocument.<anonymous> (~/AppData/Local/atom/app-1.17.2/resources/app/src/window-event-handler.js:3:1)

Commands

     -0:14.5.0 keybinding-cheatsheet:toggle (div.package-detail.panels-item)
     -0:10.9.0 aligner:align (input.hidden-input)

Non-Core Packages

aligner 1.2.1 
aligner-javascript 1.1.0 
atom-beautify 0.29.26 
docblockr 0.10.3 
file-icons 2.1.7 
highlight-selected 0.13.1 
keybinding-cheatsheet 0.1.1 
minimap 4.28.2 
minimap-highlight-selected 4.6.1 
multi-cursor 2.1.5 
open-recent 5.0.0 
platformio-ide-terminal 2.5.1 
simple-drag-drop-text 0.3.4 
symbols-tree-view 0.14.0 
tab-smart-sort 0.3.0 
todo-show 1.11.0 
adrianlee44 commented 7 years ago

Thanks for reporting this issue. When you hit Ctrl+Alt+/ again in the cheat sheet pane, are you just looking to hide the cheat sheet?

kravlost commented 7 years ago

It does usually just close the cheat sheet pane. I'm not sure what the correct operation should be when two packages use the same shortcut!

adrianlee44 commented 7 years ago

I bumped aligner to v1.2.2 which should help with the issue when you are on the cheat sheet.

kravlost commented 7 years ago

Great, thanks.