temporarily disable 'strip_cwd_prefix'

main
bhagwan 3 years ago
parent 58031b63d9
commit 2f30c9cb21

@ -251,9 +251,9 @@ M.make_entry_file = function(opts, x)
-- fd v8.3 requires adding '--strip-cwd-prefix' to remove
-- the './' prefix, will not work with '--color=always'
-- https://github.com/sharkdp/fd/blob/master/CHANGELOG.md
if not (opts.strip_cwd_prefix == false) then
x = path.strip_cwd_prefix(x)
end
-- if not (opts.strip_cwd_prefix == false) and path.starts_with_cwd(x) then
-- x = x:sub(3)
-- end
if opts.cwd and #opts.cwd > 0 then
-- TODO: does this work if there are ANSI escape codes in x?
x = path.relative(x, opts.cwd)

@ -11,8 +11,12 @@ M.starts_with_separator = function(path)
return path:find(M.separator()) == 1
end
M.starts_with_cwd = function(path)
return path:match("^."..M.separator()) ~= nil
end
M.strip_cwd_prefix = function(path)
return path:gsub("^."..M.separator(), "")
return #path>1 and path[1] == '.' and path[2] == M.separator()
end
function M.tail(path)

Loading…
Cancel
Save