From b0128cccd37c4ab3ab923296f172293829381b3d Mon Sep 17 00:00:00 2001 From: phanium <91544758+phanen@users.noreply.github.com> Date: Fri, 17 Apr 2026 00:39:50 +0800 Subject: [PATCH] fix(actions): don't stay in quickfix on edit actions This seems regression of abacb0693d7a37de9e85e6fcb2d22d848cb75cef. Before that commit, we actually rely on an old vim behavior: https://github.com/neovim/neovim/blob/5b0ad4a0607498616b984c63ae1a6903cb835c66/src/nvim/window.c#L3036 When close a window, vim try to avoid to focus a quickfix window: (even your "last accessed window" is alraedy a quickfix window...) > If the cursor goes to the preview or the quickfix window, try > finding another window to go to. --- lua/fzf-lua/actions.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/fzf-lua/actions.lua b/lua/fzf-lua/actions.lua index a2745f709..eb24c12fa 100644 --- a/lua/fzf-lua/actions.lua +++ b/lua/fzf-lua/actions.lua @@ -204,6 +204,7 @@ end ---@param bufedit boolean? ---@return string? M.vimcmd_entry = function(vimcmd, selected, opts, bufedit) + vim.api.nvim_set_current_win(vim.bo.bt == "quickfix" and vim.fn.win_getid(vim.fn.winnr("#")) or 0) for i, sel in ipairs(selected) do (function() -- Lua 5.1 goto compatiblity hack (function wrap)