fix: bat previewer with LSP 'force_uri=true' (#409)

main
bhagwan 2 years ago
parent 3a288a65b6
commit 74831cf138

@ -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

@ -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)

Loading…
Cancel
Save