aki77 / atom-expand-region

expanding selection
https://atom.io/packages/expand-region
MIT License
89 stars 9 forks source link

Uncaught TypeError: undefined is not a function #1

Closed bsander closed 9 years ago

bsander commented 9 years ago

Hi! I was very happy to see a plugin like this for atom since it's one of the things holding me back from Sublime. Unfortunately, I get the below error when using it. Can you help?

[Enter steps to reproduce below:]

  1. Run expansion command on any javascript file

Atom Version: 1.0.7 System: Mac OS X 10.10.4 Thrown From: expand-region package, v0.2.2

Stack Trace

Uncaught TypeError: undefined is not a function

At /Users/Sander/src/dotfiles/atom.symlink/packages/expand-region/lib/expand-region.coffee:14

TypeError: undefined is not a function
  at ExpandRegion.module.exports.ExpandRegion.expand (/Users/Sander/src/dotfiles/atom.symlink/packages/expand-region/lib/expand-region.coffee:14:30)
  at atom-text-editor.<anonymous> (/Users/Sander/src/dotfiles/atom.symlink/packages/expand-region/lib/expand-region.coffee:1:1)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/src/command-registry.js:241:29)
  at /opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:524:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:347:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:177:20)
aki77 commented 9 years ago

Please post your keymaps.cson file.

bsander commented 9 years ago
'atom-text-editor':
  'cmd-shift-space': 'expand-region:expand'
  'alt-shift-space': 'expand-region:shrink'

It's literally the only thing there. I still get the same error if I replace it with the snippet from your README.

aki77 commented 9 years ago

When Atom v1.0.7 on OSX, I can't reproduce this issue.. Please try reinstall the package.

$ apm uninstall expand-region
$ apm install expand-region
bsander commented 9 years ago

Hmm. That didn't work, but after ditching my entire ~/.atom directory and reinstalling the error appears to have vanished. Thanks.

aki77 commented 9 years ago

:smiley:

bsander commented 9 years ago

@aki77 ha, I figured out the cause. If you're still interested, you can probably reproduce it by unchecking "Use Shadow DOM" in the Atom settings and restarting the app.

aki77 commented 9 years ago

Thank you for reporting.

renzo-biffa commented 8 years ago

Hi ! this plugin seems to be just perfect for what Im looking to achieve, but unfortunately can't make it work, keymaps.cson file:

'atom-text-editor': 'cmd-shift-space': 'expand-region:expand' 'alt-shift-space': 'expand-region:shrink'


"Use Shadow DOM" disabled also, but ... still doesn't work. If you maybe can give a hand with this will be great !

Atom Version: 1.10.2 System: Mac OS X 10.11.6 Thrown From: expand-region package, v0.2.4

Thanks.