aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen_eval_files.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-08-23 16:32:15 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-08-23 18:24:14 +0800
commit0ba27bb51d3297aec43e78050cc3adcf6879db22 (patch)
tree9ea8990c9bebeca06d5a5e3989f0a70239797610 /scripts/gen_eval_files.lua
parent99265d099c2c366eea936438734a323d1fb9b341 (diff)
downloadrneovim-0ba27bb51d3297aec43e78050cc3adcf6879db22.tar.gz
rneovim-0ba27bb51d3297aec43e78050cc3adcf6879db22.tar.bz2
rneovim-0ba27bb51d3297aec43e78050cc3adcf6879db22.zip
vim-patch:9.0.1710: scrolloff options work slightly different
Problem: sidescrolloff and scrolloff options work slightly different than other global-local options Solution: Make it behave consistent for all global-local options It was noticed, that sidescrolloff and scrolloff options behave differently in comparison to other global-local window options like 'listchars' So make those two behave like other global-local options. Also add some extra documentation for a few special local-window options. Add a few tests to make sure all global-local window options behave similar closes: vim/vim#12956 closes: vim/vim#12643 https://github.com/vim/vim/commit/4a8eb6e7a9df10f79bf95301ced012f0d6a13088 Co-authored-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'scripts/gen_eval_files.lua')
-rwxr-xr-xscripts/gen_eval_files.lua32
1 files changed, 31 insertions, 1 deletions
diff --git a/scripts/gen_eval_files.lua b/scripts/gen_eval_files.lua
index 9bc9e99c46..2990eef069 100755
--- a/scripts/gen_eval_files.lua
+++ b/scripts/gen_eval_files.lua
@@ -542,6 +542,36 @@ local function scope_to_doc(s)
return 'global or '..m[s[2]]..' |global-local|'
end
+-- @param o vim.option_meta
+-- @return string
+local function scope_more_doc(o)
+ if
+ vim.list_contains({
+ 'previewwindow',
+ 'scroll',
+ 'winfixheight',
+ 'winfixwidth',
+ }, o.full_name)
+ then
+ return ' |special-local-window-option|'
+ end
+
+ if
+ vim.list_contains({
+ 'bufhidden',
+ 'buftype',
+ 'filetype',
+ 'modified',
+ 'readonly',
+ 'syntax',
+ }, o.full_name)
+ then
+ return ' |special-local-buffer-option|'
+ end
+
+ return ''
+end
+
--- @return table<string,vim.option_meta>
local function get_option_meta()
local opts = require('src/nvim/options').options
@@ -624,7 +654,7 @@ local function render_option_doc(_f, opt, write)
write(string.format('%s\t%s', name_str, otype))
end
- write('\t\t\t'..scope_to_doc(opt.scope))
+ write('\t\t\t'..scope_to_doc(opt.scope)..scope_more_doc(opt))
for _, l in ipairs(split(opt.desc)) do
if l == '<' or l:match('^<%s') then
write(l)