mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 02:38:46 +00:00
fix(picker.format): extra slash in path
This commit is contained in:
parent
16d700eb65
commit
dad3e00e83
2 changed files with 1 additions and 3 deletions
|
@ -57,9 +57,6 @@ function M.filename(item, picker)
|
|||
path = vim.fn.fnamemodify(item.file, ":t")
|
||||
ret[#ret + 1] = { path, base_hl, field = "file" }
|
||||
else
|
||||
if item.dir then
|
||||
path = path .. "/"
|
||||
end
|
||||
local dir, base = path:match("^(.*)/(.+)$")
|
||||
if base and dir then
|
||||
if picker.opts.formatters.file.filename_first then
|
||||
|
|
|
@ -33,6 +33,7 @@ function M.truncpath(path, len, opts)
|
|||
path = "~" .. path:sub(#home + 1)
|
||||
end
|
||||
end
|
||||
path = path:gsub("/$", "")
|
||||
|
||||
if vim.api.nvim_strwidth(path) <= len then
|
||||
return path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue