aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/lua-guide.txt
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2023-07-07 16:37:36 +0100
committerGitHub <noreply@github.com>2023-07-07 16:37:36 +0100
commitc379d72c490544b3a56eb0e52ce3c8ef740051d8 (patch)
tree33ad95a9eb7a11d2136009516f0c492b8d8d6580 /runtime/doc/lua-guide.txt
parent804108af6c79ae20d372a6c295ff292887d40c20 (diff)
downloadrneovim-c379d72c490544b3a56eb0e52ce3c8ef740051d8.tar.gz
rneovim-c379d72c490544b3a56eb0e52ce3c8ef740051d8.tar.bz2
rneovim-c379d72c490544b3a56eb0e52ce3c8ef740051d8.zip
feat(lua): allow vim.wo to be double indexed (#20288)
* feat(lua): allow vim.wo to be double indexed Problem: `vim.wo` does not implement `setlocal` Solution: Allow `vim.wo` to be double indexed Co-authored-by: Christian Clason <c.clason@uni-graz.at>
Diffstat (limited to 'runtime/doc/lua-guide.txt')
-rw-r--r--runtime/doc/lua-guide.txt5
1 files changed, 4 insertions, 1 deletions
diff --git a/runtime/doc/lua-guide.txt b/runtime/doc/lua-guide.txt
index b138de85c9..28c9ace23b 100644
--- a/runtime/doc/lua-guide.txt
+++ b/runtime/doc/lua-guide.txt
@@ -363,7 +363,7 @@ and `:let &listchars='space:_,tab:>~'`:
• |vim.o|: behaves like |:set|
• |vim.go|: behaves like |:setglobal|
• |vim.bo|: for buffer-scoped options
-• |vim.wo|: for window-scoped options
+• |vim.wo|: for window-scoped options (can be double indexed)
For example:
>lua
@@ -386,6 +386,9 @@ window is used:
>lua
vim.bo[4].expandtab = true -- sets expandtab to true in buffer 4
vim.wo.number = true -- sets number to true in current window
+ vim.wo[0].number = true -- same as above
+ vim.wo[0][0].number = true -- sets number to true in current buffer
+ -- in current window only
print(vim.wo[0].number) --> true
<
------------------------------------------------------------------------------