bigfive / atom-sublime-select

Enable 'sublime style' multiline selection boxes to Atom editor http://atom.io
MIT License
233 stars 49 forks source link

Problem deleting start of line to wrap muliple lines into one line : TypeError: Cannot read property 'length' of undefined #118

Open ghost opened 8 years ago

ghost commented 8 years ago

This error happens when I have a multiple cursors across many rows and the cursor is at the begining of the line and I delete. I am attempting to move all the rows into one row. Only happens when cursor is at start of line.

/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:873 Hide Stack Trace TypeError: Cannot read property 'length' of undefined at SublimeSelectEditorHandler.module.exports.SublimeSelectEditorHandler._selectBoxAroundCursors (/Users/auser/.atom/packages/sublime-style-column-selection/lib/editor-handler.coffee:119:56) at SublimeSelectEditorHandler.module.exports.SublimeSelectEditorHandler.onRangeChange (/Users/auser/.atom/packages/sublime-style-column-selection/lib/editor-handler.coffee:72:10) at /Users/auser/.atom/packages/sublime-style-column-selection/lib/editor-handler.coffee:1:1 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 TextEditor.module.exports.TextEditor.selectionRangeChanged (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:2452:27) at Selection.module.exports.Selection.markerDidChange (/Applications/Atom.app/Contents/Resources/app.asar/src/selection.js:924:26) at /Applications/Atom.app/Contents/Resources/app.asar/src/selection.js:41:24 at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/node_modules/event-kit/lib/emitter.js:25:14) at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/node_modules/event-kit/lib/emitter.js:129:28) at DisplayMarker.module.exports.DisplayMarker.notifyObservers (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/display-marker.js:245:27) at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/display-marker.js:53:26 at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/node_modules/event-kit/lib/emitter.js:25:14) at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/node_modules/event-kit/lib/emitter.js:129:28) at Marker.module.exports.Marker.emitChangeEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/marker.js:425:20) at Marker.module.exports.Marker.update (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/marker.js:366:12) at Marker.module.exports.Marker.setHeadPosition (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/marker.js:146:19) at DisplayMarker.module.exports.DisplayMarker.setHeadBufferPosition (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/display-marker.js:146:32) at DisplayMarker.module.exports.DisplayMarker.setHeadScreenPosition (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/display-marker.js:154:19) at /Applications/Atom.app/Contents/Resources/app.asar/src/cursor.js:67:31 at Cursor.module.exports.Cursor.changePosition (/Applications/Atom.app/Contents/Resources/app.asar/src/cursor.js:671:7) at Cursor.module.exports.Cursor.setScreenPosition (/Applications/Atom.app/Contents/Resources/app.asar/src/cursor.js:65:19) at Cursor.module.exports.Cursor.moveLeft (/Applications/Atom.app/Contents/Resources/app.asar/src/cursor.js:257:21) at /Applications/Atom.app/Contents/Resources/app.asar/src/selection.js:244:31 at Selection.module.exports.Selection.modifySelection (/Applications/Atom.app/Contents/Resources/app.asar/src/selection.js:972:7) at Selection.module.exports.Selection.selectLeft (/Applications/Atom.app/Contents/Resources/app.asar/src/selection.js:242:19) at Selection.module.exports.Selection.backspace (/Applications/Atom.app/Contents/Resources/app.asar/src/selection.js:509:14) at /Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:957:26 at /Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:973:29 at TextBuffer.module.exports.TextBuffer.transact (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:868:18) at TextEditor.module.exports.TextEditor.transact (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:1390:26) at /Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:967:24 at TextEditor.module.exports.TextEditor.mergeSelections (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:2365:43) at TextEditor.module.exports.TextEditor.mergeIntersectingSelections (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:2331:35) at TextEditor.module.exports.TextEditor.mutateSelectedText (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:965:19) at TextEditor.module.exports.TextEditor.backspace (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:956:19) at TextEditor.object.(anonymous function) as backspace at TextEditor.commandRegistry.add.stopEventPropagationAndGroupUndo.core:backspace (/Applications/Atom.app/Contents/Resources/app.asar/src/register-default-commands.js:420:21) at /Applications/Atom.app/Contents/Resources/app.asar/src/register-default-commands.js:661:34 at TextBuffer.module.exports.TextBuffer.transact (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:868:18) at TextEditor.module.exports.TextEditor.transact (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:1390:26) at atom-text-editor.newCommandListeners.(anonymous function) (/Applications/Atom.app/Contents/Resources/app.asar/src/register-default-commands.js:660:22) 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:580:16) at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:388:22) at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:98:36) at HTMLDocument. (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:3:61)

jd73 commented 8 years ago

👍

bigfive commented 7 years ago

Confirmed as bug, can reproduce. I'll fix this in the next release, thanks for the report. Sorry about the delay