[nvim] fix: correctly shorten "_XXX" elements in statusline
This commit is contained in:
parent
9aae779da4
commit
55c27719d3
@ -113,7 +113,11 @@ local function shorten_path(path, max_len)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local segment = segments[idx]
|
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
|
segments[idx] = shortened
|
||||||
len = len - (#segment - #shortened)
|
len = len - (#segment - #shortened)
|
||||||
end
|
end
|
||||||
@ -211,7 +215,6 @@ local function statusline_focused()
|
|||||||
"%=",
|
"%=",
|
||||||
right
|
right
|
||||||
}
|
}
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function statusline_not_focused()
|
local function statusline_not_focused()
|
||||||
|
Reference in New Issue
Block a user