diff options
Diffstat (limited to 'runtime/lua/vim/fs.lua')
-rw-r--r-- | runtime/lua/vim/fs.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/lua/vim/fs.lua b/runtime/lua/vim/fs.lua index a47b35e991..28a531707f 100644 --- a/runtime/lua/vim/fs.lua +++ b/runtime/lua/vim/fs.lua @@ -152,25 +152,25 @@ end --- --- Path to begin searching from. If --- omitted, the |current-directory| is used. ---- @field path string +--- @field path? string --- --- Search upward through parent directories. --- Otherwise, search through child directories (recursively). --- (default: `false`) ---- @field upward boolean +--- @field upward? boolean --- --- Stop searching when this directory is reached. --- The directory itself is not searched. ---- @field stop string +--- @field stop? string --- --- Find only items of the given type. --- If omitted, all items that match {names} are included. ---- @field type string +--- @field type? string --- --- Stop the search after finding this many matches. --- Use `math.huge` to place no limit on the number of matches. --- (default: `1`) ---- @field limit number +--- @field limit? number --- Find files or directories (or other items as specified by `opts.type`) in the given path. --- @@ -229,7 +229,7 @@ function M.find(names, opts) names = { names } end - local path = opts.path or vim.uv.cwd() + local path = opts.path or assert(vim.uv.cwd()) local stop = opts.stop local limit = opts.limit or 1 |