aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/if_lua.txt27
-rw-r--r--runtime/doc/vim_diff.txt2
2 files changed, 28 insertions, 1 deletions
diff --git a/runtime/doc/if_lua.txt b/runtime/doc/if_lua.txt
index 470f3bde7a..2e4d32027d 100644
--- a/runtime/doc/if_lua.txt
+++ b/runtime/doc/if_lua.txt
@@ -9,7 +9,32 @@ Lua Interface to Nvim *lua* *Lua*
Type <M-]> to see the table of contents.
==============================================================================
-1. Commands *lua-commands*
+1. Importing modules *lua-require*
+
+Neovim lua interface automatically adjusts `package.path` and `package.cpath`
+according to effective &runtimepath value. Adjustment happens after each time
+'runtimepath' is changed, `package.path` and `package.cpath` are adjusted by
+prepending directories from 'runtimepath' each suffixed by `/lua` and
+`?`-containing suffixes from `package.path` and `package.cpath`. I.e. when
+'runtimepath' option contains `/foo` and `package.path` contains only
+`./a?d/j/g.nlua;./?.lua;/bar/?.lua` the resulting `package.path` after
+adjustments will look like this: >
+
+ /foo/lua/?.lua;/foo/lua/a?d/j/g.nlua;./a?d/j/g.nlua;./?.lua;/bar/?.lua
+
+Note that code have taken everything starting from the last path component
+from existing paths containing a question mark as a `?`-containing suffix, but
+only applied unique suffixes.
+
+Note 2: even though adjustments happens automatically Neovim does not track
+current values of `package.path` or `package.cpath`. If you happened to delete
+some paths from there you need to reset 'runtimepath' to make them readded.
+
+Note 3: paths from 'runtimepath' which contain semicolons cannot be put into
+`package.[c]path` and thus are ignored.
+
+==============================================================================
+2. Commands *lua-commands*
*:lua*
:[range]lua {chunk}
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 8851ef2d4b..24410ddaac 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -244,6 +244,8 @@ Lua interface (|if_lua.txt|):
while calling lua chunk: [string "<VimL compiled string>"]:1: TEST” in
Neovim.
- Lua has direct access to Nvim |API| via `vim.api`.
+- Lua package.path and package.cpath are automatically updated according to
+ 'runtimepath': |lua-require|.
- Currently, most legacy Vim features are missing.
|input()| and |inputdialog()| gained support for each other’s features (return