fix(picker): correctly normalize path after fnamemodify

This commit is contained in:
Folke Lemaitre 2025-01-16 08:56:56 +01:00
parent 1f8a41fa83
commit f351dcfcac
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -25,8 +25,8 @@ function M.filename(item, picker)
if not item.file then
return ret
end
local path = vim.fs.normalize(item.file)
path = vim.fn.fnamemodify(path, ":~:.")
local path = vim.fn.fnamemodify(item.file, ":~:.")
path = vim.fs.normalize(path)
local name, cat = path, "file"
if item.buf and vim.api.nvim_buf_is_loaded(item.buf) then
name = vim.bo[item.buf].filetype