Skip to content

Commit

Permalink
fix: correctly create User autocmd in action.which_key (#2736)
Browse files Browse the repository at this point in the history
(cherry picked from commit 550055e)
  • Loading branch information
Conni2461 committed Oct 11, 2023
1 parent 296668f commit 7011eaa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/telescope/actions/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,8 @@ actions.which_key = function(prompt_bufnr, opts)
-- only set up autocommand after showing preview completed
if opts.close_with_action then
vim.schedule(function()
vim.api.nvim_create_autocmd("User TelescopeKeymap", {
vim.api.nvim_create_autocmd("User", {
pattern = "TelescopeKeymap",
once = true,
callback = function()
pcall(vim.api.nvim_win_close, km_win_id, true)
Expand Down

0 comments on commit 7011eaa

Please sign in to comment.