halohalospecial / atom-elmjutsu

A bag of tricks for developing with Elm. (Atom package)
https://atom.io/packages/elmjutsu
MIT License
192 stars 24 forks source link

"Uncaught TypeError: Cannot read property 'add' of null" on the second use of 'Lift to Let' #50

Closed mandrolic closed 7 years ago

mandrolic commented 7 years ago

Lift to let works fine the first time. the next time it does not and throws this error. Undoing the lift operation and re applying in the exact same scenario makes it happen, so it just seems to be throwing in all cases the second time, the code does not matter.

Atom Version: 1.13.0 Electron Version: 1.3.13 System: Microsoft Windows 10 Pro Thrown From: elmjutsu package, v3.1.0

Stack Trace

Uncaught TypeError: Cannot read property 'add' of null


At C:\Users\andrew\AppData\Local\atom\app-1.13.0\resources\app.asar\node_modules\text-buffer\lib\text-buffer.js:872

TypeError: Cannot read property 'add' of null
    at ActOnSelection.handleEndOfAct (file:///C:/Users/andrew/.atom/packages/elmjutsu/lib/act-on-selection.js:30:23)
    at file:///C:/Users/andrew/.atom/packages/elmjutsu/lib/act-on-selection.js:190:14
    at TextBuffer.module.exports.TextBuffer.transact (C:\Users\andrew\AppData\Local\atom\app-1.13.0\resources\app.asar\node_modules\text-buffer\lib\text-buffer.js:867:18)
    at TextEditor.module.exports.TextEditor.transact (C:\Users\andrew\AppData\Local\atom\app-1.13.0\resources\app.asar\src\text-editor.js:1566:26)
    at ActOnSelection.liftToLetCommand (file:///C:/Users/andrew/.atom/packages/elmjutsu/lib/act-on-selection.js:71:14)
    at atom-text-editor.elmjutsuLiftToLet (file:///C:/Users/andrew/.atom/packages/elmjutsu/lib/main.js:39:57)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\andrew\AppData\Local\atom\app-1.13.0\resources\app.asar\src\command-registry.js:259:29)
    at C:\Users\andrew\AppData\Local\atom\app-1.13.0\resources\app.asar\src\command-registry.js:3:59
    at CommandPaletteView.module.exports.CommandPaletteView.confirmed (C:\Users\andrew\AppData\Local\atom\app-1.13.0\resources\app.asar\node_modules\command-palette\lib\command-palette-view.js:210:32)
    at CommandPaletteView.module.exports.SelectListView.confirmSelection (C:\Users\andrew\AppData\Local\atom\app-1.13.0\resources\app.asar\node_modules\atom-space-pen-views\lib\select-list-view.js:338:21)
    at space-pen-div.atom.commands.add.core:confirm (C:\Users\andrew\AppData\Local\atom\app-1.13.0\resources\app.asar\node_modules\atom-space-pen-views\lib\select-list-view.js:109:19)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\andrew\AppData\Local\atom\app-1.13.0\resources\app.asar\src\command-registry.js:259:29)
    at C:\Users\andrew\AppData\Local\atom\app-1.13.0\resources\app.asar\src\command-registry.js:3:59
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (C:\Users\andrew\AppData\Local\atom\app-1.13.0\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:587:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (C:\Users\andrew\AppData\Local\atom\app-1.13.0\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:382:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (C:\Users\andrew\AppData\Local\atom\app-1.13.0\resources\app.asar\src\window-event-handler.js:106:36)
    at HTMLDocument.<anonymous> (C:\Users\andrew\AppData\Local\atom\app-1.13.0\resources\app.asar\src\window-event-handler.js:3:59)