From 550055e640fd6eea88430ba5da3a3bc08679cf94 Mon Sep 17 00:00:00 2001 From: Simon Hauser Date: Wed, 11 Oct 2023 08:07:30 +0200 Subject: [PATCH] fix: correctly create User autocmd in action.which_key (#2736) --- lua/telescope/actions/init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/telescope/actions/init.lua b/lua/telescope/actions/init.lua index dd483f3..7049d18 100644 --- a/lua/telescope/actions/init.lua +++ b/lua/telescope/actions/init.lua @@ -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)