neil-lindquist / lisp-paredit

Paredit for Atom
MIT License
24 stars 5 forks source link

Uncaught TypeError: Cannot set property 'endIdx' of undefined #4

Closed jlgeering closed 9 years ago

jlgeering commented 9 years ago

steps to reproduce:

  1. highlight a string ("asdf")
  2. try to trigger wrap-around-parens / ctrl-alt-( => have to hit ctrl-alt-shift-8 on my keyboard

Atom Version: 1.0.3 System: Mac OS X 10.10.3 Thrown From: lisp-paredit package, v0.4.0

Stack Trace

Uncaught TypeError: Cannot set property 'endIdx' of undefined

At /Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:756

TypeError: Cannot set property 'endIdx' of undefined
  at /Users/jluf/.atom/packages/lisp-paredit/lib/edit-commands.coffee:167:9
  at TextBuffer.module.exports.TextBuffer.transact (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:751:18)
  at TextEditor.module.exports.TextEditor.transact (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:1151:26)
  at edit (/Users/jluf/.atom/packages/lisp-paredit/lib/edit-commands.coffee:159:10)
  at Array.module.exports.wrapAroundParens (/Users/jluf/.atom/packages/lisp-paredit/lib/edit-commands.coffee:48:5)
  at atom-text-editor.<anonymous> (/Users/jluf/.atom/packages/lisp-paredit/lib/utils.coffee:38:70)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:241: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:524:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:347:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:177:20)

Commands

     -0:50.5.0 emmet:next-edit-point (atom-text-editor.editor.is-focused)
  2x -0:49.8.0 core:move-up (atom-text-editor.editor.is-focused)
     -0:48.8.0 emmet:next-edit-point (atom-text-editor.editor.is-focused)
     -0:48.6.0 emmet:prev-edit-point (atom-text-editor.editor.is-focused)
     -0:48.2.0 core:move-down (atom-text-editor.editor.is-focused)
  7x -0:47.9.0 core:move-right (atom-text-editor.editor.is-focused)
     -0:46.4.0 emmet:next-edit-point (atom-text-editor.editor.is-focused)
     -0:45.6.0 emmet:wrap-with-abbreviation (atom-text-editor.editor.is-focused)
     -0:43.5.0 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
     -0:43.5.0 core:cancel (atom-text-editor.editor.mini.is-focused)
  2x -0:34.7.0 lisp-paredit:splice (atom-text-editor.editor.is-focused)
  2x -0:26 core:undo (atom-text-editor.editor.is-focused)
     -0:22.5.0 lisp-paredit:splice (atom-text-editor.editor.is-focused)
     -0:15.2.0 core:undo (atom-text-editor.editor.is-focused)
     -0:07.2.0 emmet:wrap-with-abbreviation (atom-text-editor.editor.is-focused)
     -0:01.1.0 lisp-paredit:wrap-around-parens (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "copy-config-info",
      "copy-config-info"
    ],
    "themes": [
      "atom-light-ui",
      "atom-light-syntax"
    ]
  },
  "lisp-paredit": {
    "strict": false
  }
}

=> also with strict: true

Installed Packages

# User
color-picker, v2.0.11
editorconfig, v1.0.1
emmet, v2.3.12
lisp-paredit, v0.4.0
minimap, v4.12.1
pigments, v0.9.2

# Dev
No dev packages
jlgeering commented 9 years ago

seem like it has to do with the highlighting:

jonspalding commented 9 years ago

Pushed 0.4.1 with this fix.

Thanks for raising the issue.