t9md / atom-vim-mode-plus

vim-mode improved
https://atom.io/packages/vim-mode-plus
MIT License
1.4k stars 112 forks source link

Error with 1.17.0 on Atom 1.22.0 #954

Closed limianwang closed 6 years ago

limianwang commented 6 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.22.0 x64 Electron: 1.6.15 OS: Mac OS X 10.12.6 Thrown From: vim-mode-plus package 1.17.0

Stack Trace

Uncaught TypeError: Cannot read property 'scopeDescriptorForBufferPosition' of undefined

At /Users/limianwang/.atom/packages/vim-mode-plus/lib/operation-stack.js:151

TypeError: Cannot read property 'scopeDescriptorForBufferPosition' of undefined
    at TokenizedBuffer.editor.languageMode.suggestedIndentForBufferRow (/packages/react/lib/atom-react.coffee:82:32)
    at TextEditor.module.exports.TextEditor.suggestedIndentForBufferRow (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:3733:41)
    at TextEditor.module.exports.TextEditor.autoIndentBufferRow (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:3738:32)
    at Selection.module.exports.Selection.insertText (/Applications/Atom.app/Contents/Resources/app/src/selection.js:494:27)
    at /Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1215:35
    at /Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1254:34
    at TextBuffer.module.exports.TextBuffer.transact (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:952:24)
    at TextEditor.module.exports.TextEditor.transact (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1687:32)
    at /Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1248:30
    at TextEditor.module.exports.TextEditor.mergeSelections (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:2635:24)
    at TextEditor.module.exports.TextEditor.mergeIntersectingSelections (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:2597:41)
    at TextEditor.module.exports.TextEditor.mutateSelectedText (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1246:25)
    at TextEditor.module.exports.TextEditor.insertText (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1212:25)
    at TextEditor.object.(anonymous function) [as insertText] (/Applications/Atom.app/Contents/Resources/app/node_modules/underscore-plus/lib/underscore-plus.js:77:33)
    at TextEditor.module.exports.TextEditor.insertNewline (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1227:25)
    at TextEditor.object.(anonymous function) [as insertNewline] (/Applications/Atom.app/Contents/Resources/app/node_modules/underscore-plus/lib/underscore-plus.js:77:33)
    at /Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1582:30
    at TextBuffer.module.exports.TextBuffer.transact (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:952:24)
    at TextEditor.module.exports.TextEditor.transact (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1687:32)
    at TextEditor.module.exports.TextEditor.insertNewlineBelow (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1579:25)
    at InsertBelowWithNewline.mutateText (/packages/vim-mode-plus/lib/operator-insert.js:297:17)
    at InsertBelowWithNewline.execute (/packages/vim-mode-plus/lib/operator-insert.js:61:33)
    at OperationStack.execute (/packages/vim-mode-plus/lib/operation-stack.js:187:33)
    at OperationStack.process (/packages/vim-mode-plus/lib/operation-stack.js:180:12)
    at OperationStack.run (/packages/vim-mode-plus/lib/operation-stack.js:96:14)
    at /packages/vim-mode-plus/lib/base.js:327:45)
    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

     -0:10.6.0 pane:show-item-1 (div.panels-item)
  4x -0:08.4.0 vim-mode-plus:move-up (input.hidden-input)
  2x -0:07.3.0 vim-mode-plus:move-down (input.hidden-input)
     -0:06.8.0 vim-mode-plus:insert-below-with-newline (input.hidden-input)
     -0:06.0 vim-mode-plus:move-to-first-character-of-line-down (input.hidden-input)
     -0:06.0 vim-mode-plus:till (input.hidden-input)
     -0:06.0 vim-mode-plus:activate-insert-mode (input.hidden-input)

Non-Core Packages

atom-beautify 0.30.6 
atom-ternjs 0.18.3 
docblockr 0.13.2 
editorconfig 2.2.2 
hybrid-next-syntax 0.9.2 
language-docker 1.1.8 
mariana-syntax 0.2.0 
oceanic-next 1.0.0 
react 0.16.3 
vim-mode-plus 1.17.0 
t9md commented 6 years ago

From stacktrace, atom-react tried call function against undefined. Did you checked stacktrace? Will close since, I don't think this is not vmp issue.

https://github.com/orktes/atom-react/blob/2e8eb9f73e01696702a133eabbf4d0a058938b98/lib/atom-react.coffee#L82

limianwang commented 6 years ago

Closing this issue. I think it had to do with react package. I disabled one of the configuration (JSX grammar auto indent) and I can no longer reproduce this issue.

limianwang commented 6 years ago

@t9md Yes, I was about to just close the issue. Thanks!

t9md commented 6 years ago

Maybe vmp's error capturing behavior obscure who threw original error. I have to think better way..