diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-05-15 19:39:35 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-15 19:39:35 +0800 |
commit | ffb4b50e74657b3b15199972371e0cff84f9cd4a (patch) | |
tree | 6e7d3d140faefc69912d0939981963ca8ee38a11 | |
parent | 61a0aa6c51fb689d196eae37de7d5a75b330efff (diff) | |
download | rneovim-ffb4b50e74657b3b15199972371e0cff84f9cd4a.tar.gz rneovim-ffb4b50e74657b3b15199972371e0cff84f9cd4a.tar.bz2 rneovim-ffb4b50e74657b3b15199972371e0cff84f9cd4a.zip |
docs(lua): restore missing indexing for vim.bo and vim.wo (#28751)
-rw-r--r-- | runtime/doc/lua.txt | 4 | ||||
-rwxr-xr-x | scripts/gen_vimdoc.lua | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index f227420c75..20a53537bc 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -1412,7 +1412,7 @@ Option:remove({value}) *vim.opt:remove()* Parameters: ~ • {value} (`string`) Value to remove -vim.bo *vim.bo* +vim.bo[{bufnr}] *vim.bo* Get or set buffer-scoped |options| for the buffer with number {bufnr}. If {bufnr} is omitted then the current buffer is used. Invalid {bufnr} or key is an error. @@ -1462,7 +1462,7 @@ vim.o *vim.o* print(vim.o.foo) -- error: invalid key < -vim.wo *vim.wo* +vim.wo[{winid}][{bufnr}] *vim.wo* Get or set window-scoped |options| for the window with handle {winid} and buffer with number {bufnr}. Like `:setlocal` if setting a |global-local| option or if {bufnr} is provided, like `:set` otherwise. If {winid} is diff --git a/scripts/gen_vimdoc.lua b/scripts/gen_vimdoc.lua index 085b1f5bea..6d0fc46145 100755 --- a/scripts/gen_vimdoc.lua +++ b/scripts/gen_vimdoc.lua @@ -614,6 +614,12 @@ local function render_fun_header(fun, cfg) if fun.classvar then nm = fmt('%s:%s', fun.classvar, nm) end + if nm == 'vim.bo' then + nm = 'vim.bo[{bufnr}]' + end + if nm == 'vim.wo' then + nm = 'vim.wo[{winid}][{bufnr}]' + end local proto = fun.table and nm or nm .. '(' .. table.concat(args, ', ') .. ')' |