MattFlower/organized

Uncaught TypeError: Cannot read property 'indentLevel' of null

nix-bohon opened this issue · 1 comments

[Enter steps to reproduce:]

  1. I created a header line (starting with #) then followed it by a bullet line (starting with *). I hit enter from the end of the header line, and the exception was thrown.

Atom: 1.14.4 x64
Electron: 1.3.13
OS: Microsoft Windows 10 Pro
Thrown From: organized package 0.5.5

Stack Trace

Uncaught TypeError: Cannot read property 'indentLevel' of null

At C:\Users\zache\AppData\Local\atom\app-1.14.4\resources\app.asar\node_modules\text-buffer\lib\text-buffer.js:824

TypeError: Cannot read property 'indentLevel' of null
    at /packages/organized/lib/organized.coffee:332:43
    at TextBuffer.module.exports.TextBuffer.transact (/app.asar/node_modules/text-buffer/lib/text-buffer.js:819:18)
    at TextEditor.module.exports.TextEditor.transact (/app.asar/src/text-editor.js:1551:26)
    at Object.newStarLine (/packages/organized/lib/organized.coffee:326:14)
    at /packages/organized/lib/organized.coffee:97:101)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/app.asar/src/command-registry.js:259:29)
    at /app.asar/src/command-registry.js:3:59
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:599:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:390:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/app.asar/src/window-event-handler.js:106:36)
    at /app.asar/src/window-event-handler.js:3:59)

Commands

  3x -1:01.1.0 core:backspace (input.hidden-input)
     -0:36.6.0 organized:newStarLine (input.hidden-input)
     -0:32.4.0 organized:unindent (input.hidden-input)
     -0:28.3.0 editor:select-to-first-character-of-line (input.hidden-input)
  4x -0:27.6.0 core:backspace (input.hidden-input)
 17x -0:25.1.0 core:move-up (input.hidden-input)
     -0:23.7.0 core:move-down (input.hidden-input)
     -0:23.3.0 core:move-up (input.hidden-input)
     -0:23 organized:newStarLine (input.hidden-input)
     -0:14 editor:move-to-first-character-of-line (input.hidden-input)
     -0:13.5.0 organized:newStarLine (input.hidden-input)
     -0:13.2.0 core:move-up (input.hidden-input)
  6x -0:09.7.0 core:backspace (input.hidden-input)
     -0:08.2.0 core:move-up (input.hidden-input)
     -0:07.8.0 editor:move-to-end-of-screen-line (input.hidden-input)
     -0:07.5.0 organized:newStarLine (input.hidden-input)

Non-Core Packages

atom-beautify 0.29.17 
atom-sublime-monokai-syntax 0.4.4 
data-atom 0.24.1 
language-tsql 0.19.0 
language-vbscript 0.7.0 
monokai-dark 1.3.0 
organized 0.5.5 

This should be fixed in 0.5.7. Thanks for the super-thorough report.