From 661b5de13b6b55cde035373e39e4321210acc4b0 Mon Sep 17 00:00:00 2001 From: bhagwan Date: Mon, 16 Dec 2024 08:52:41 -0800 Subject: [PATCH] fix(ui_select): restore INSERT mode (closes #1572) --- lua/fzf-lua/providers/ui_select.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/fzf-lua/providers/ui_select.lua b/lua/fzf-lua/providers/ui_select.lua index dd111f6c..c5a67895 100644 --- a/lua/fzf-lua/providers/ui_select.lua +++ b/lua/fzf-lua/providers/ui_select.lua @@ -110,6 +110,10 @@ M.ui_select = function(items, ui_opts, on_choice) opts.fn_selected = function(selected, o) config.set_action_helpstr(o.actions.enter, nil) + if o.__CTX.mode == "i" then + vim.cmd [[noautocmd lua vim.api.nvim_feedkeys('i', 'n', true)]] + end + if not selected then -- with `actions.dummy_abort` this doesn't get called anymore -- as the action is configured as a valid fzf "accept" (thus