From b273a358a7a33bebcf6e5c1ef1adc25439083023 Mon Sep 17 00:00:00 2001 From: bhagwan Date: Wed, 9 Feb 2022 12:14:25 -0800 Subject: [PATCH] bugfix: NULL buffer creation on LSP actions (closes #341) --- lua/fzf-lua/actions.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/fzf-lua/actions.lua b/lua/fzf-lua/actions.lua index 0e3988d..5b0b634 100644 --- a/lua/fzf-lua/actions.lua +++ b/lua/fzf-lua/actions.lua @@ -103,7 +103,13 @@ M.vimcmd_file = function(vimcmd, selected, opts) if not is_term then vim.cmd("normal! m`") end -- only change buffer if we need to (issue #122) if vimcmd ~= "e" or curbuf ~= fullpath then - vim.cmd(vimcmd .. " " .. vim.fn.fnameescape(entry.path)) + if entry.path then + -- do not run ': ' for uri entries (#341) + vim.cmd(vimcmd .. " " .. vim.fn.fnameescape(entry.path)) + elseif vimcmd ~= 'e' then + -- uri entries only execute new buffers (new|vnew|tabnew) + vim.cmd(vimcmd) + end end -- Java LSP entries, 'jdt://...' or LSP locations if entry.uri then