diff options
author | Lewis Russell <lewis6991@gmail.com> | 2022-12-22 10:23:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-22 10:23:19 +0000 |
commit | ceb533181ca828364d0ed4e1b31293f81780fa2c (patch) | |
tree | 27c4b96c7b0aca454d912e6ebe575d6fdcca206f /runtime/doc | |
parent | ff45a142b6a776f3ff11bdabac1a72d735ceca82 (diff) | |
parent | fb5576c2d36464b55c2c639aec9259a6f2461970 (diff) | |
download | rneovim-ceb533181ca828364d0ed4e1b31293f81780fa2c.tar.gz rneovim-ceb533181ca828364d0ed4e1b31293f81780fa2c.tar.bz2 rneovim-ceb533181ca828364d0ed4e1b31293f81780fa2c.zip |
Merge pull request #21402 from lewis6991/feat/fs_ls
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 9c98ed7771..1459392a81 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -2295,13 +2295,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 013089acc7..2ce0bd4de2 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -77,6 +77,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. |