mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
fix(lualine): weird path truncation when not under cwd/root
It does not make sense to truncate unless root actually in path. Also, should probably check if opts.relative == "root" otherwise the substitution can be surprising (since user expects substitution only wrt. cwd)
This commit is contained in:
parent
3dbace941e
commit
772dd5c32f
1 changed files with 1 additions and 1 deletions
|
|
@ -96,7 +96,7 @@ function M.pretty_path(opts)
|
||||||
|
|
||||||
if opts.relative == "cwd" and path:find(cwd, 1, true) == 1 then
|
if opts.relative == "cwd" and path:find(cwd, 1, true) == 1 then
|
||||||
path = path:sub(#cwd + 2)
|
path = path:sub(#cwd + 2)
|
||||||
else
|
elseif opts.relative == "root" and path:find(root, 1, true) == 1 then
|
||||||
path = path:sub(#root + 2)
|
path = path:sub(#root + 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue