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
  • Loading branch information
Conni2461 committed Oct 11, 2023
1 parent fd00a0a commit 550055e
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 @@ -1409,7 +1409,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 550055e

Please sign in to comment.