refactor(types): more fixes

This commit is contained in:
Lewis Russell
2024-03-06 10:03:55 +00:00
committed by Lewis Russell
parent d72c9d1d19
commit ea44f74d84
8 changed files with 84 additions and 40 deletions

View File

@@ -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