fix(which_key): close window on mouse click action (#3053)
* fix(which_key): close window on mouse click action `nvim_buf_delete` is not allowed during text change or window change. Window switching with left mouse click was leading to race condition/error. * [docgen] Update doc/telescope.txt skip-checks: true --------- Co-authored-by: Github Actions <actions@github>
This commit is contained in:
@@ -3678,6 +3678,8 @@ action_generate.which_key({opts}) *telescope.actions.generate.which_key()*
|
||||
"TelescopePromptBorder")
|
||||
{winblend} (number) pseudo-transparency of keymap
|
||||
hints floating window
|
||||
{zindex} (number) z-index of keymap hints floating
|
||||
window (default: 100)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1428,9 +1428,11 @@ actions.which_key = function(prompt_bufnr, opts)
|
||||
buffer = close_buffer,
|
||||
once = true,
|
||||
callback = function()
|
||||
vim.schedule(function()
|
||||
pcall(vim.api.nvim_win_close, km_win_id, true)
|
||||
pcall(vim.api.nvim_win_close, km_opts.border.win_id, true)
|
||||
require("telescope.utils").buf_delete(km_buf)
|
||||
utils.buf_delete(km_buf)
|
||||
end)
|
||||
end,
|
||||
})
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user