mirror of https://github.com/folke/lazy.nvim.git
fix(ui): open diff and others over the ui. Don't try to be smart about it. Fixes #361
This commit is contained in:
parent
0741d62319
commit
3fbe4fe27a
|
@ -7,29 +7,7 @@ end
|
|||
|
||||
---@param opts? LazyFloatOptions
|
||||
function M.float(opts)
|
||||
opts = opts or {}
|
||||
local cursor
|
||||
local View = require("lazy.view")
|
||||
if View.visible() then
|
||||
-- set cursor to the top of the ui, so the tabs are visible
|
||||
cursor = vim.api.nvim_win_get_cursor(View.view.win)
|
||||
vim.api.nvim_win_set_cursor(View.view.win, { 1, 0 })
|
||||
opts = vim.tbl_deep_extend("force", {
|
||||
zindex = 60,
|
||||
border = "none",
|
||||
margin = { top = 3, left = 2, right = 2 },
|
||||
}, opts)
|
||||
end
|
||||
local ret = require("lazy.view.float")(opts)
|
||||
-- restore the cursor
|
||||
if cursor then
|
||||
ret:on("BufLeave", function()
|
||||
if View.visible() then
|
||||
vim.api.nvim_win_set_cursor(View.view.win, cursor)
|
||||
end
|
||||
end, { once = true })
|
||||
end
|
||||
return ret
|
||||
return require("lazy.view.float")(opts)
|
||||
end
|
||||
|
||||
function M.open(uri)
|
||||
|
|
Loading…
Reference in New Issue