Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggle case seems to be broken #3

Closed
valo opened this issue Feb 9, 2016 · 2 comments
Closed

Toggle case seems to be broken #3

valo opened this issue Feb 9, 2016 · 2 comments

Comments

@valo
Copy link
Contributor

valo commented Feb 9, 2016

When I try to use the case toggle I get the error below. It seems the issue that the toggle function is not passing a selection to the functions here: https://github.com/andersennl/case-switch/blob/master/lib/selector.coffee#L8

Atom Version: 1.4.3
System: Mac OS X 10.11.3
Thrown From: case-switch package, v2.0.1

Stack Trace

Uncaught TypeError: Cannot read property 'getText' of undefined

At /Users/valentin/.atom/packages/case-switch/lib/selector.coffee:38

TypeError: Cannot read property 'getText' of undefined
    at Selector.module.exports.Selector.isHyphenCase (/Users/valentin/.atom/packages/case-switch/lib/selector.coffee:38:14)
    at Selector.module.exports.Selector.toggleSelection (/Users/valentin/.atom/packages/case-switch/lib/selector.coffee:9:9)
    at Object.module.exports.CaseSwitch.toggle (/Users/valentin/.atom/packages/case-switch/lib/case-switch.coffee:17:20)
    at atom-workspace.<anonymous> (/Users/valentin/.atom/packages/case-switch/lib/case-switch.coffee:11:67)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:536:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:359:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:97:36)
    at HTMLDocument.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:3:61)

Commands

     -0:07.6.0 core:select-down (atom-text-editor.editor.is-focused)
     -0:07.4.0 core:cut (atom-text-editor.editor.is-focused)
  4x -0:07.3.0 core:move-down (atom-text-editor.editor.is-focused)
     -0:06.7.0 core:paste (atom-text-editor.editor.is-focused)
  2x -0:06.5.0 core:move-up (atom-text-editor.editor.is-focused)
     -0:05.5.0 core:save (atom-text-editor.editor.is-focused)
  2x -0:05.4.0 core:move-down (atom-text-editor.editor.is-focused)
     -0:05.1.0 core:select-down (atom-text-editor.editor.is-focused)
     -0:04.8.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:04.3.0 core:save (atom-text-editor.editor.is-focused)
     -0:04.3.0 pane:show-previous-item (atom-text-editor.editor.is-focused)
  4x -0:03.6.0 core:move-up (atom-text-editor.editor.is-focused)
  2x -0:03.0 editor:move-to-end-of-word (atom-text-editor.editor.is-focused)
     -0:02.6.0 editor:select-to-beginning-of-word (atom-text-editor.editor.is-focused)
  2x -0:02.2.0 editor:select-to-end-of-word (atom-text-editor.editor.is-focused)
     -0:00.9.0 case-switch:toggle (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "ignoredNames": [
      ".git/"
    ],
    "projectHome": "/Users/valentin/workspace"
  }
}

Installed Packages

# User
advanced-open-file, v0.14.2
case-switch, v2.0.1
emmet, v2.3.17
expand-region, v0.2.4
git-plus, v5.12.0
goto, v1.7.1
language-emblem, v0.2.0
language-rspec, v0.3.0
language-slim, v0.5.0
rails-rspec, v0.3.2
rails-transporter, v1.6.5
ruby-block, v0.3.5
ruby-block-converter, v3.5.0

# Dev
No dev packages
@valo
Copy link
Contributor Author

valo commented Feb 9, 2016

Added a PR with a fix

@andersennl
Copy link
Owner

Hi @valo thanks a lot for the heads up and pr, I'll take a look at it asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants