chore: refine creating floating win (#182)

This commit is contained in:
yetone
2024-08-24 02:33:35 +08:00
committed by GitHub
parent 4693da8757
commit f2173c9a3c
2 changed files with 22 additions and 16 deletions

View File

@@ -24,13 +24,13 @@ setmetatable(FloatingWindow, {
end,
})
---@class opts
---@class FloatingWindowOptions
---@field enter? boolean
---@field buf_options? table<string, any>
---@field win_options? table<string, any>
---@field float_options? table<string, any>
---@param opts opts
---@param opts FloatingWindowOptions
---@return FloatingWindow
function FloatingWindow.new(opts)
local instance = setmetatable({}, FloatingWindow)
@@ -47,7 +47,7 @@ function FloatingWindow.new(opts)
end
---@param split_winid integer
---@param opts opts
---@param opts FloatingWindowOptions
---@return FloatingWindow
function FloatingWindow.from_split_win(split_winid, opts)
local split_win_width = api.nvim_win_get_width(split_winid)