Skip to content

With 'nosplitscroll' and 'splitbelow' a window is sometimes unexpectedly scrolled when Vim's help window is closed #11147

@bfrg

Description

@bfrg

Steps to reproduce

  1. First set the terminal window to approximately 40 lines and 80 columns. Check with $LINES and $COLUMNS.
  2. Then run vim --clean test.vim -S test.vim, with
set nosplitscroll
set splitbelow

" empty lines
" empty lines
" empty lines
" empty lines
" empty lines
" empty lines
" empty lines
" empty lines
" empty lines
" empty lines
" empty lines
" empty lines
" empty lines
" empty lines
" empty lines
" empty lines
" empty lines
" empty lines
" empty lines
" empty lines
" empty lines

" augroup test
"     autocmd!
" augroup END
  1. Move the cursor to the very last line and place it on augroup. Then press K to open the help for augroup. When opening the split, the previously focused window is NOT scrolled. Immediately close the help window with :q.
  2. Result: The previously focused window that displays test.vim has been scrolled.

For some reasons this depends on the size of the terminal window as well as on the location of the cursor in the current window before the split occurs. When opening a new split, the last window is never scrolled but when closing the new split the last window is often scrolled.

Expected behaviour

No scrolling when Vim's help window is closed.

Version of Vim

9.0.478

Environment

Linux, alacritty terminal

Logs and stack traces

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions