Skip to content

Conversation

mhinz
Copy link
Member

@mhinz mhinz commented Mar 22, 2019

Nvim doesn't expect a window-changing command on an created-window event.

autocmd WinNew * wincmd p
help help
  • A snapshot for window 1000 is created.
  • The window is split and the cursor changes to the new window 1001.
  • The autocmd kicks in and switches back to 1000.
  • The help buffer is opened.
  • On closing the help window 1000, it tries to go back to the snapshotted window
    which is... 1000.
  • wp1000->w_buffer == NULL
  • w_buffer is used by check_cursor()
  • 🧨 -> 💥

Fixes #9773

Nvim doesn't expect a window-changing command on an created-window event.

  autocmd WinNew * wincmd p
  help help

- A snapshot for window 1000 is created.
- The window is split and the cursor changes to the new window 1001.
- The autocmd kicks in and switches back to 1000.
- The help buffer is opened.
- On closing the help window 1000, it tries to go back to the snapshotted window
  which is... 1000.
- wp1000->w_buffer == NULL
- w_buffer is used by check_cursor()
- 🧨 -> 💥

Fixes neovim#9773
@justinmk justinmk added the core Nvim core functionality or code label Mar 22, 2019
@justinmk justinmk added this to the 0.4 milestone Mar 22, 2019
@mhinz mhinz merged commit 3e78319 into neovim:master Mar 22, 2019
@mhinz mhinz deleted the crash-snapshot branch March 22, 2019 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Nvim core functionality or code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants