feat(buffers): replace $HOME with '~' for paths outside of cwd (#436)

This commit is contained in:
bhagwan 2022-06-08 14:08:02 -07:00
parent fc30750436
commit 7817c4205e

View File

@ -119,6 +119,8 @@ local function gen_buffer_entry(opts, buf, hl_curbuf)
if opts.filename_only then
bufname = path.basename(bufname)
end
-- replace $HOME with '~' for paths ourside of cwd
bufname = bufname:gsub("^"..vim.env.HOME, "~")
-- add line number
bufname = ("%s:%s"):format(bufname, buf.info.lnum>0 and buf.info.lnum or "")
if buf.flag == '%' then