feat(api): allow passing options to float so it can be used outside of lazy

This commit is contained in:
Folke Lemaitre 2022-12-30 10:23:12 +01:00
parent d205cd45d0
commit 2a617a7024
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 6 additions and 4 deletions

View file

@ -84,10 +84,10 @@ function M.throttle(ms, fn)
end
---@param cmd string[]
---@param opts? {cwd:string, filetype:string, terminal?:boolean, close_on_exit?:boolean, enter?:boolean}
---@param opts? {cwd:string, filetype:string, terminal?:boolean, close_on_exit?:boolean, enter?:boolean, float?:LazyViewOptions}
function M.open_cmd(cmd, opts)
opts = opts or {}
local float = M.float()
local float = M.float(opts.float)
if opts.filetype then
vim.bo[float.buf].filetype = opts.filetype