commit 8ef3dd3afa20024f439d8b7a69f316069c1909d3 parent 0264870c0aa50fd4e34fb8a6b3c3c3cd88a22db7 Author: zeertzjq <zeertzjq@outlook.com> Date: Wed, 9 Oct 2024 19:31:14 +0800 docs(lua): "vim.bo" is always equivalent to :setlocal (#30733) vim.bo :lua vim.bo.textwidth = 80 :setglobal textwidth? textwidth=0 :setlocal :setlocal textwidth=80 :setglobal textwidth? textwidth=0 :set :set textwidth=80 :setglobal textwidth? textwidth=80 Diffstat:
| M | runtime/doc/lua.txt | | | 9 | +++------ |
| M | runtime/lua/vim/_options.lua | | | 4 | +--- |
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt @@ -1464,12 +1464,9 @@ Option:remove({value}) *vim.opt:remove()* • {value} (`string`) Value to remove 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. - - Note: this is equivalent to `:setlocal` for |global-local| options and - `:set` otherwise. + Get or set buffer-scoped |options| for the buffer with number {bufnr}. + Like `:setlocal`. If {bufnr} is omitted then the current buffer is used. + Invalid {bufnr} or key is an error. Example: >lua local bufnr = vim.api.nvim_get_current_buf() diff --git a/runtime/lua/vim/_options.lua b/runtime/lua/vim/_options.lua @@ -274,11 +274,9 @@ vim.go = setmetatable({}, { }) --- Get or set buffer-scoped |options| for the buffer with number {bufnr}. ---- If {bufnr} is omitted then the current buffer is used. +--- Like `:setlocal`. If {bufnr} is omitted then the current buffer is used. --- Invalid {bufnr} or key is an error. --- ---- Note: this is equivalent to `:setlocal` for |global-local| options and `:set` otherwise. ---- --- Example: --- --- ```lua