From 640d6415baf6b12c20c16fdd177f106c5575d6c1 Mon Sep 17 00:00:00 2001 From: bhagwan Date: Sat, 18 Nov 2023 17:38:08 -0800 Subject: [PATCH] fix(action): "cursor position outside buffer" (#930) --- lua/fzf-lua/actions.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/fzf-lua/actions.lua b/lua/fzf-lua/actions.lua index 8736d3c6..0f444c1e 100644 --- a/lua/fzf-lua/actions.lua +++ b/lua/fzf-lua/actions.lua @@ -148,7 +148,7 @@ M.vimcmd_file = function(vimcmd, selected, opts) -- make sure we have valid column -- 'nvim-dap' for example sets columns to 0 entry.col = entry.col and entry.col > 0 and entry.col or 1 - vim.api.nvim_win_set_cursor(0, { tonumber(entry.line), tonumber(entry.col) - 1 }) + pcall(vim.api.nvim_win_set_cursor, 0, { tonumber(entry.line), tonumber(entry.col) - 1 }) end if not is_term and not opts.no_action_zz then vim.cmd("norm! zvzz") end ::continue::