fix: fix close hover window twice in some case
This commit is contained in:
parent
c154ee94b5
commit
09806f01a6
@ -198,7 +198,11 @@ local action = {
|
|||||||
if pin then
|
if pin then
|
||||||
error('too many window')
|
error('too many window')
|
||||||
end
|
end
|
||||||
api.nvim_del_autocmd(cmd_id)
|
if cmd_id > 0 then
|
||||||
|
api.nvim_del_autocmd(cmd_id)
|
||||||
|
cmd_id = -1
|
||||||
|
end
|
||||||
|
|
||||||
m_window:set('wrap', false)
|
m_window:set('wrap', false)
|
||||||
|
|
||||||
m_window:try_close(function()
|
m_window:try_close(function()
|
||||||
@ -206,7 +210,7 @@ local action = {
|
|||||||
relative = 'editor',
|
relative = 'editor',
|
||||||
row = 1,
|
row = 1,
|
||||||
col = vim.o.columns - m_window.width - 3,
|
col = vim.o.columns - m_window.width - 3,
|
||||||
}, function ()
|
}, function()
|
||||||
m_window:set('wrap', true)
|
m_window:set('wrap', true)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@ -228,6 +232,11 @@ local action = {
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
close = function()
|
close = function()
|
||||||
|
if cmd_id > 0 then
|
||||||
|
api.nvim_del_autocmd(cmd_id)
|
||||||
|
cmd_id = -1
|
||||||
|
end
|
||||||
|
|
||||||
m_window:set('wrap', false)
|
m_window:set('wrap', false)
|
||||||
m_window:try_close()
|
m_window:try_close()
|
||||||
try_del_keymap()
|
try_del_keymap()
|
||||||
@ -266,7 +275,7 @@ return function(word)
|
|||||||
end
|
end
|
||||||
|
|
||||||
m_window:draw(true)
|
m_window:draw(true)
|
||||||
m_window:open(function ()
|
m_window:open(function()
|
||||||
m_window:set('wrap', true)
|
m_window:set('wrap', true)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user