Fix issue with trimming path separator '/'

This commit is contained in:
Rui Marques
2020-09-22 22:38:38 +02:00
committed by TJ DeVries
parent 541c4c33e6
commit 6b23ef988b

View File

@@ -212,7 +212,12 @@ function make_entry.gen_from_buffer(opts)
-- if bufname is inside the cwd, trim that part of the string -- if bufname is inside the cwd, trim that part of the string
if bufname:sub(1, #cwd) == cwd then if bufname:sub(1, #cwd) == cwd then
bufname = bufname:sub(#cwd + 1, #bufname) local offset = 0
-- if cwd does ends in '/', we need to take it off
if cwd:sub(#cwd, #cwd) ~= '/' then
offset = 1
end
bufname = bufname:sub(#cwd + 1 + offset, #bufname)
end end
local position = get_position(entry) local position = get_position(entry)