t9md / atom-vim-mode-plus

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

Uncaught TypeError: Cannot read property 'getHeadBufferPosition' of undefined #966

Closed jacekkopecky closed 6 years ago

jacekkopecky commented 6 years ago

Steps to reproduce:

  1. in a new file, press o<esc> to add a line
  2. press .

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

Stack Trace

Uncaught TypeError: Cannot read property 'getHeadBufferPosition' of undefined

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

TypeError: Cannot read property 'getHeadBufferPosition' of undefined
    at InsertBelowWithNewline.groupChangesSinceBufferCheckpoint (/packages/vim-mode-plus/lib/operator-insert.js:254:67)
    at InsertBelowWithNewline.execute (/packages/vim-mode-plus/lib/operator-insert.js:71:14)
    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 OperationStack.runRecorded (/packages/vim-mode-plus/lib/operation-stack.js:123:10)
    at VimState.repeat (/packages/vim-mode-plus/lib/main.js:165:38)
    at HTMLElement.didDispatch (/packages/vim-mode-plus/lib/main.js:201:30)
    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

     -1:15.8.0 vim-mode-plus:insert-after (input.hidden-input)
  3x -1:14.3.0 editor:newline (input.hidden-input)
     -1:11.7.0 intentions:highlight (input.hidden-input)
     -1:11.5.0 vim-mode-plus:activate-normal-mode (input.hidden-input)
  3x -1:11.4.0 vim-mode-plus:move-up (input.hidden-input)
     -1:10.8.0 vim-mode-plus:insert-below-with-newline (input.hidden-input)
     -1:08.7.0 intentions:highlight (input.hidden-input)
     -1:08.6.0 vim-mode-plus:activate-normal-mode (input.hidden-input)
  2x -1:07.2.0 vim-mode-plus:move-down (input.hidden-input)
     -1:06.8.0 vim-mode-plus:repeat (input.hidden-input)
     -0:36 settings-view:open (input.hidden-input)
     -0:05.6.0 vim-mode-plus:move-down (input.hidden-input)
     -0:05.4.0 vim-mode-plus:repeat (input.hidden-input)

Non-Core Packages

atom-fuzzy-grep 0.16.0 
atom-html-preview 0.2.2 
atom-jshint 2.0.0 
atom-material-syntax 1.0.7 
atom-material-syntax-light 0.4.6 
atom-material-ui 2.0.6 
atom-runner 2.7.1 
autocomplete-ctags 0.4.1 
base16-darker-high-contrast-syntax 1.5.1-0 
block-selection-mode 0.3.0 
busy-signal 1.4.3 
coffeescript-check 0.2.0 
cursor-history 0.12.0 
emmet-simplified 2.5.0 
figlet 0.5.4 
foldername-tabs 0.2.4 
git-plus 7.10.0 
highlight-nbsp 0.1.1 
highlight-selected 0.13.1 
hip-light-ui-theme 1.1.1 
imdone-atom 2.2.7 
incremental-search 5.2.2 
intentions 1.1.5 
jacek-ui-theme 0.1.1 
js-refactor 0.7.5 
jshint 1.8.6 
jumpy 4.1.1 
language-latex 1.1.1 
lazy-motion 0.7.0 
linter 2.2.0 
linter-eslint 8.4.0 
linter-htmlhint 1.4.0 
linter-scss-lint 3.1.1 
linter-tidy 2.3.1 
linter-ui-default 1.6.10 
markdown-toc 0.4.2 
material-ui 1.0.10 
merge-conflicts 1.4.5 
minimap 4.29.7 
multi-cursor 2.1.5 
multi-wrap-guide 1.0.0 
no-dock-arrows 1.0.1 
open-recent 5.0.0 
pipe 0.4.0 
refactor 0.11.5 
single-click-open 0.2.2 
solarized-light-ui 0.1.0 
sort-lines 0.18.0 
two-light-ui 1.1.3 
vim-mode-plus 1.19.0 
t9md commented 6 years ago

Hi @jacekkopecky long time no see. Are you now vmp user?

Btw I can see how this happen(bad code I should fix), but cannot understand why this happen? Since I cannot reproduce it. Can you reproduce it always? Any additional condition to repro?

jacekkopecky commented 6 years ago

Hi @t9md, yes, I've been using vmp for a long time now (of course); I never regained time to work on vim-mode after the summer of 2015. When I have some time, I want to have a look at vmp, but you've been doing a great job! 8-)

But to the issue at hand: I'll see if I can reproduce it outside my environment.

t9md commented 6 years ago

OK.... Let me clear, at least one PC you can reproduce issue always by just o escape . three keystroke?

jacekkopecky commented 6 years ago

It's the Group Changes When Leaving Insert Mode setting, when false, the exception happens, when true, it doesn't.

jacekkopecky commented 6 years ago

Yes, always o<esc>. triggers it.

t9md commented 6 years ago

OK, thanks! will check!