mirror of https://github.com/folke/lazy.nvim.git
fix(ui): focus Lazy window when auto-installing plugins in `VimEnter`
This commit is contained in:
parent
d4aee2715f
commit
1fe43f3e29
|
@ -65,9 +65,19 @@ function M.show(mode)
|
||||||
opts.col = (vim.o.columns - opts.width) / 2
|
opts.col = (vim.o.columns - opts.width) / 2
|
||||||
local win = vim.api.nvim_open_win(buf, true, opts)
|
local win = vim.api.nvim_open_win(buf, true, opts)
|
||||||
M._win = win
|
M._win = win
|
||||||
|
|
||||||
vim.api.nvim_set_current_win(win)
|
vim.api.nvim_set_current_win(win)
|
||||||
|
|
||||||
|
-- it seems that setting the current win doesn't work before VimEnter,
|
||||||
|
-- so do that then
|
||||||
|
if vim.v.vim_did_enter ~= 1 then
|
||||||
|
vim.api.nvim_create_autocmd("VimEnter", {
|
||||||
|
once = true,
|
||||||
|
callback = function()
|
||||||
|
vim.api.nvim_set_current_win(win)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
vim.bo[buf].buftype = "nofile"
|
vim.bo[buf].buftype = "nofile"
|
||||||
vim.bo[buf].bufhidden = "wipe"
|
vim.bo[buf].bufhidden = "wipe"
|
||||||
vim.wo[win].conceallevel = 3
|
vim.wo[win].conceallevel = 3
|
||||||
|
|
Loading…
Reference in New Issue