fix: correctly create User autocmd in action.which_key (#2736)

This commit is contained in:
Simon Hauser
2023-10-11 08:07:30 +02:00
committed by GitHub
parent fd00a0a269
commit 550055e640

View File

@@ -1409,7 +1409,8 @@ actions.which_key = function(prompt_bufnr, opts)
-- only set up autocommand after showing preview completed -- only set up autocommand after showing preview completed
if opts.close_with_action then if opts.close_with_action then
vim.schedule(function() vim.schedule(function()
vim.api.nvim_create_autocmd("User TelescopeKeymap", { vim.api.nvim_create_autocmd("User", {
pattern = "TelescopeKeymap",
once = true, once = true,
callback = function() callback = function()
pcall(vim.api.nvim_win_close, km_win_id, true) pcall(vim.api.nvim_win_close, km_win_id, true)