mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
refactor: easier to pass window options for floats
This commit is contained in:
parent
d3b0d3e851
commit
13af39b83e
4 changed files with 62 additions and 49 deletions
|
@ -25,13 +25,17 @@ local M = {}
|
|||
---@type LazyView
|
||||
M.view = nil
|
||||
|
||||
function M.visible()
|
||||
return M.view and M.view.win and vim.api.nvim_win_is_valid(M.view.win)
|
||||
end
|
||||
|
||||
---@param mode? string
|
||||
function M.show(mode)
|
||||
if Config.headless then
|
||||
return
|
||||
end
|
||||
|
||||
M.view = (M.view and M.view.win and vim.api.nvim_win_is_valid(M.view.win)) and M.view or M.create()
|
||||
M.view = M.visible() and M.view or M.create()
|
||||
if mode then
|
||||
M.view.state.mode = mode
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue