vim-patch:9.2.0356: Cannot apply 'scrolloff' context lines at end of file

Problem:  Cannot apply 'scrolloff' context lines at end of file
Solution: Add the 'scrolloffpad' option to keep 'scrolloff' context even
          when at the end of the file (McAuley Penney).

closes: vim/vim#19040

a414630393

Co-authored-by: McAuley Penney <jacobmpenney@gmail.com>
This commit is contained in:
zeertzjq
2026-04-20 20:47:50 +08:00
parent 1569a71c8a
commit 8f1e14ffa2
16 changed files with 1044 additions and 17 deletions

View File

@@ -124,7 +124,8 @@ func Test_screenpos()
setlocal nonumber display=lastline so=0
exe "normal G\<C-Y>\<C-Y>"
redraw
call assert_equal({'row': winrow + wininfo.height - 1,
let winbar_height = get(wininfo, 'winbar', 0)
call assert_equal({'row': winrow + wininfo.height - 1 + winbar_height,
\ 'col': wincol + 7,
\ 'curscol': wincol + 7,
\ 'endcol': wincol + 7}, winid->screenpos(line('$'), 8))