From 589c7a4ee68a391659d27b57b86a3b1993d38340 Mon Sep 17 00:00:00 2001 From: bhagwan Date: Mon, 7 Feb 2022 08:49:49 -0800 Subject: [PATCH] file actions: only move cursor if required (closes #339) --- 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 832b1d6..0e3988d 100644 --- a/lua/fzf-lua/actions.lua +++ b/lua/fzf-lua/actions.lua @@ -111,7 +111,7 @@ M.vimcmd_file = function(vimcmd, selected, opts) elseif entry.ctag then vim.api.nvim_win_set_cursor(0, {1, 0}) vim.fn.search(entry.ctag, "W") - elseif tonumber(entry.line)>0 then + elseif entry.line>1 or entry.col>1 then entry.col = entry.col or 1 vim.api.nvim_win_set_cursor(0, {tonumber(entry.line), tonumber(entry.col)-1}) end