aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/lua.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/lua.txt')
-rw-r--r--runtime/doc/lua.txt19
1 files changed, 14 insertions, 5 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 737aa91e97..1110fb7fc3 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -1002,10 +1002,18 @@ Log levels are one of the values defined in `vim.log.levels`:
------------------------------------------------------------------------------
LUA-VIMSCRIPT BRIDGE *lua-vimscript*
-Nvim Lua provides an interface to Vimscript variables and functions, and
-editor commands and options.
+Nvim Lua provides an interface or "bridge" to Vimscript variables and
+functions, and editor commands and options.
+
+Objects passed over this bridge are COPIED (marshalled): there are no
+"references". |lua-guide-variables| For example, using `vim.fn.remove()` on
+a Lua list copies the list object to Vimscript and does NOT modify the Lua
+list: >lua
+
+ local list = { 1, 2, 3 }
+ vim.fn.remove(list, 0)
+ vim.print(list) --> "{ 1, 2, 3 }"
-See also https://github.com/nanotee/nvim-lua-guide.
vim.call({func}, {...}) *vim.call()*
Invokes |vim-function| or |user-function| {func} with arguments {...}.
@@ -2970,8 +2978,9 @@ range({spec}) *vim.version.range()*
Lua module: iter *lua-iter*
-The *vim.iter* module provides a generic "iterator" interface over tables
-and iterator functions.
+The *vim.iter* module provides a generic interface for working with
+iterables: tables, lists, iterator functions, pair()/ipair()-like
+iterators, and `vim.iter()` objects.
*vim.iter()* wraps its table or function argument into an *Iter* object
with methods (such as |Iter:filter()| and |Iter:map()|) that transform the