mirror of
https://github.com/neovim/neovim.git
synced 2026-08-26 00:51:53 +00:00
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:
@@ -7237,8 +7237,8 @@ local options = {
|
||||
Minimal number of screen lines to keep above and below the cursor.
|
||||
This will make some context visible around where you are working. If
|
||||
you set it to a very large value (999) the cursor line will always be
|
||||
in the middle of the window (except at the start or end of the file or
|
||||
when long lines wrap).
|
||||
in the middle of the window (except at the start or end of the file,
|
||||
see 'scrolloffpad', or when long lines wrap).
|
||||
After using the local value, go back the global value with one of
|
||||
these two: >vim
|
||||
setlocal scrolloff<
|
||||
@@ -7251,6 +7251,31 @@ local options = {
|
||||
type = 'number',
|
||||
varname = 'p_so',
|
||||
},
|
||||
{
|
||||
abbreviation = 'sop',
|
||||
defaults = 0,
|
||||
desc = [=[
|
||||
When 'scrolloff' and 'scrolloffpad' are greater than zero, allow
|
||||
the cursor to remain centered when at the end of the file.
|
||||
Normally, 'scrolloff' will not keep the cursor centered at the
|
||||
end of the file.
|
||||
|
||||
A value of 0 disables this feature. Any value above 0 enables it.
|
||||
For a window-local value, -1 means to use the global value.
|
||||
Values below -1 are invalid.
|
||||
|
||||
After using the local value, go back the global value with one of
|
||||
these two: >vim
|
||||
setlocal scrolloffpad<
|
||||
setlocal scrolloffpad=-1
|
||||
<
|
||||
]=],
|
||||
full_name = 'scrolloffpad',
|
||||
scope = { 'global', 'win' },
|
||||
short_desc = N_("keep 'scrolloff' context even at end of file"),
|
||||
type = 'number',
|
||||
varname = 'p_sop',
|
||||
},
|
||||
{
|
||||
abbreviation = 'sbo',
|
||||
defaults = 'ver,jump',
|
||||
|
||||
Reference in New Issue
Block a user