diff options
Diffstat (limited to 'runtime/doc')
-rw-r--r-- | runtime/doc/lua.txt | 7 | ||||
-rw-r--r-- | runtime/doc/news.txt | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 5a1c186192..5364477d13 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -2245,13 +2245,18 @@ basename({file}) *vim.fs.basename()* Return: ~ (string) Basename of {file} -dir({path}) *vim.fs.dir()* +dir({path}, {opts}) *vim.fs.dir()* Return an iterator over the files and directories located in {path} Parameters: ~ • {path} (string) An absolute or relative path to the directory to iterate over. The path is first normalized |vim.fs.normalize()|. + • {opts} table|nil Optional keyword arguments: + • depth: integer|nil How deep the traverse (default 1) + • skip: (fun(dir_name: string): boolean)|nil Predicate to + control traversal. Return false to stop searching the + current directory. Only useful when depth > 1 Return: ~ Iterator over files and directories in {path}. Each iteration yields diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index bd0d1cfc5b..9c9b616913 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -73,6 +73,9 @@ The following new APIs or features were added. Similarly, the `virtual_text` configuration in |vim.diagnostic.config()| now has a `suffix` option which does nothing by default. +• |vim.fs.dir()| now has a `opts` argument with a depth field to allow + recursively searching a directory tree. + • |vim.secure.read()| reads a file and prompts the user if it should be trusted and, if so, returns the file's contents. |