feat: disable cursor in preview window (#433)
This commit is contained in:
parent
b0a6cf9898
commit
b15e4c1e64
1 changed files with 8 additions and 0 deletions
|
|
@ -114,6 +114,11 @@ M.show = vim.schedule_wrap(function(actions, should_confirm, cb)
|
|||
|
||||
render_lines(winid, bufnr, lines)
|
||||
|
||||
-- Disable cursor
|
||||
-- We are in the preview window now, so no need to use autocmd with WinEnter
|
||||
vim.api.nvim_set_hl(0, "OilPreviewCursor", { nocombine = true, blend = 100 })
|
||||
vim.opt.guicursor:append("a:OilPreviewCursor/OilPreviewCursor")
|
||||
|
||||
-- Attach autocmds and keymaps
|
||||
local cancel
|
||||
local confirm
|
||||
|
|
@ -127,6 +132,9 @@ M.show = vim.schedule_wrap(function(actions, should_confirm, cb)
|
|||
end
|
||||
autocmds = {}
|
||||
vim.api.nvim_win_close(winid, true)
|
||||
-- restore cursor
|
||||
vim.api.nvim_set_hl(0, "OilPreviewCursor", {})
|
||||
vim.opt.guicursor:remove("a:OilPreviewCursor/OilPreviewCursor")
|
||||
cb(value)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue