tgandrews / atom-easy-jsdoc

JSDoc hot key for atom editor.
Other
41 stars 11 forks source link

Uncaught TypeError: Cannot read property 'getCursorBufferPosition' of undefined #57

Closed liucaihe closed 7 years ago

liucaihe commented 7 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.18.0-beta0 x64 Electron: 1.3.15 OS: Mac OS X 10.12.5 Thrown From: atom-easy-jsdoc package 4.12.1

Stack Trace

Uncaught TypeError: Cannot read property 'getCursorBufferPosition' of undefined

At /Users/liucaihe/.atom/packages/atom-easy-jsdoc/lib/index.js:37

TypeError: Cannot read property 'getCursorBufferPosition' of undefined
    at continueComment (/packages/atom-easy-jsdoc/lib/index.js:37:25)
    at /packages/atom-easy-jsdoc/lib/index.js:61:9)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom Beta.app/Contents/Resources/app/src/command-registry.js:265:1)
    at /Applications/Atom Beta.app/Contents/Resources/app/src/command-registry.js:3:1
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:610:1)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:401:1)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom Beta.app/Contents/Resources/app/src/window-event-handler.js:100:1)
    at HTMLDocument.<anonymous> (/Applications/Atom Beta.app/Contents/Resources/app/src/window-event-handler.js:3:1)

Commands

  2x -6:40.5.0 core:backspace (input.hidden-input)
     -6:29.3.0 snippets:next-tab-stop (input.hidden-input)
     -6:29.3.0 snippets:expand (input.hidden-input)
     -6:29.3.0 editor:indent (input.hidden-input)
     -6:28.9.0 core:paste (input.hidden-input)
 18x -5:57.3.0 find-and-replace:select-next (input.hidden-input)
  2x -3:53.2.0 core:save (input.hidden-input)
     -3:44.8.0 intentions:highlight (input.hidden-input)
  3x -2:10.1.0 find-and-replace:select-next (input.hidden-input)
     -2:03.6.0 editor:delete-to-beginning-of-line (input.hidden-input)
     -2:03.2.0 core:backspace (input.hidden-input)
  2x -2:02.5.0 core:save (input.hidden-input)
  7x -1:44.5.0 core:backspace (input.hidden-input)
     -0:41.9.0 editor:newline (input.hidden-input)
  2x -0:32.2.0 core:copy (atom-notification.fatal.icon.icon-bug.native-key-bindings.has-detail.has-close.has-stack)
     -0:02.5.0 editor:newline (input.hidden-input)

Non-Core Packages

activate-power-mode 1.4.0 
angularjs 0.4.0 
atom-easy-jsdoc 4.12.1 
atom-less 0.1.10 
autocomplete-paths 1.0.5 
autoprefixer 3.7.0 
busy-signal 1.4.1 
color-picker 2.2.5 
expose 0.14.0 
file-icons 2.1.6 
filecolor 0.4.0 
git-plus 7.8.0 
intentions 1.1.2 
language-jsx 0.1.1 
language-vue 0.21.2 
less-build 0.1.0 
less-compiler 0.6.2 
linter 2.1.4 
linter-eslint 8.1.7 
linter-ui-default 1.5.4 
simplified-chinese-menu 5.3.1 
vue-autocomplete 0.1.1 
vue-format 0.4.0 
Peeja commented 7 years ago

Still seeing this in v4.12.3:

  1. Be staging a commit in the git pane.
  2. Press Return while composing commit message.
  3. Line break is inserted normally, and nothing I would expect to happen fails to happen, but this error is thrown.

Atom: 1.21.0 x64 Electron: 1.6.9 OS: Mac OS X 10.12.6 Thrown From: atom-easy-jsdoc package 4.12.3

Stack Trace

Uncaught TypeError: Cannot read property 'getCursorBufferPosition' of undefined

At /Users/peeja/.atom/packages/atom-easy-jsdoc/lib/regex/jsdoc.js:29

TypeError: Cannot read property 'getCursorBufferPosition' of undefined
    at continueComments (/packages/atom-easy-jsdoc/lib/regex/jsdoc.js:29:33)
    at Object.newline (/packages/atom-easy-jsdoc/lib/regex/jsdoc.js:130:9)
    at HTMLElement.editorNewline (/packages/atom-easy-jsdoc/lib/index.js:67:20)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:381:36)
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:621:22)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:412:28)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:100:42)
    at HTMLDocument.<anonymous> (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:3:65)

Commands

     -2:57.5.0 datatip:toggle (input.hidden-input)
  2x -2:57.4.0 editor:delete-to-beginning-of-word (input.hidden-input)
  2x -2:56.8.0 datatip:toggle (input.hidden-input)
  3x -2:52.8.0 editor:delete-to-beginning-of-word (input.hidden-input)
  2x -2:52.1.0 datatip:toggle (input.hidden-input)
  2x -2:48.8.0 editor:delete-to-beginning-of-word (input.hidden-input)
     -2:48.3.0 datatip:toggle (input.hidden-input)
     -2:46.7.0 editor:consolidate-selections (input.hidden-input)
     -2:46.7.0 core:cancel (input.hidden-input)
     -2:40.2.0 github:toggle-github-tab-focus (ul.list-inline.tab-bar.inset-panel)
     -2:27 github:toggle-git-tab-focus (atom-pane.pane.active)
     -2:19 editor:consolidate-selections (input.hidden-input)
     -2:19 core:cancel (input.hidden-input)
     -1:05.8.0 core:save (input.hidden-input)
  8x -0:28.2.0 core:backspace (input.hidden-input)
  2x -0:21.4.0 editor:newline (input.hidden-input)

Non-Core Packages

atom-easy-jsdoc 4.12.3 
autocomplete-modules 1.7.2 
busy-signal 1.4.3 
change-case 0.6.5 
clojure-indent 0.4.0 
expand-region 0.3.2 
file-icons 2.1.12 
haskell-grammar 0.4.0 
highlight-line 0.12.0 
highlight-selected 0.13.1 
intentions 1.1.5 
language-babel 2.75.1 
language-graphql 0.9.0 
language-ini 1.19.0 
language-lua 0.9.11 
language-ocaml 1.9.5 
language-rust 0.4.12 
language-swift 0.5.0 
language-thrift 1.0.2 
linter 2.2.0 
linter-eslint 8.3.2 
MagicPython 1.0.12 
multi-cursor 2.1.5 
nuclide 0.258.0 
nuclide-format-js 0.0.41 
prettier-atom 0.40.0 
set-syntax 0.4.0 
sort-lines 0.15.0 
terminal-plus 0.14.5 
tool-bar 1.1.0 
tgandrews commented 7 years ago

Thanks, managed to recreate. A quick workaround is to enable the beta.