From 74831cf13841ebe6da49e3ff9d98095f124514be Mon Sep 17 00:00:00 2001 From: bhagwan Date: Tue, 17 May 2022 08:14:59 -0700 Subject: [PATCH] fix: bat previewer with LSP 'force_uri=true' (#409) --- lua/fzf-lua/actions.lua | 2 +- lua/fzf-lua/path.lua | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lua/fzf-lua/actions.lua b/lua/fzf-lua/actions.lua index 33ccd84..87a210a 100644 --- a/lua/fzf-lua/actions.lua +++ b/lua/fzf-lua/actions.lua @@ -86,7 +86,7 @@ M.vimcmd_file = function(vimcmd, selected, opts) local curbuf = vim.api.nvim_buf_get_name(0) local is_term = utils.is_term_buffer(0) for i = 1, #selected do - local entry = path.entry_to_file(selected[i], opts) + local entry = path.entry_to_file(selected[i], opts, opts.force_uri) entry.ctag = opts._ctag and path.entry_to_ctag(selected[i]) local fullpath = entry.path or entry.uri and entry.uri:match("^%a+://(.*)") if not path.starts_with_separator(fullpath) then diff --git a/lua/fzf-lua/path.lua b/lua/fzf-lua/path.lua index 324ccc9..ce5c6d3 100644 --- a/lua/fzf-lua/path.lua +++ b/lua/fzf-lua/path.lua @@ -194,10 +194,9 @@ function M.entry_to_location(entry, opts) } end -function M.entry_to_file(entry, opts) +function M.entry_to_file(entry, opts, force_uri) opts = opts or {} local cwd = opts.cwd - local force_uri = opts.force_uri -- Remove ansi coloring and prefixed icons entry = utils.strip_ansi_coloring(entry) local stripped, idx = stripBeforeLastOccurrenceOf(entry, utils.nbsp)