[nvim] fix: correctly shorten "_XXX" elements in statusline

This commit is contained in:
David JULIEN 2023-02-19 16:54:04 +01:00
parent 9aae779da4
commit 55c27719d3
1 changed files with 52 additions and 49 deletions

View File

@ -113,7 +113,11 @@ local function shorten_path(path, max_len)
end
local segment = segments[idx]
local shortened = segment:sub(1, vim.startswith(segment, '.') and 2 or 1)
local short_end = 1
if (vim.startswith(segment, '.') or vim.startswith(segment, '_')) then
short_end = 2
end
local shortened = segment:sub(1, short_end)
segments[idx] = shortened
len = len - (#segment - #shortened)
end
@ -211,7 +215,6 @@ local function statusline_focused()
"%=",
right
}
end
local function statusline_not_focused()