Merge branch 'dev' into mercury

nvim: fix shortened path in statusline for unfocused buffers
This commit is contained in:
David JULIEN 2023-02-13 19:32:07 +01:00
commit f8b91f7e16
Signed by: swytch
GPG Key ID: 498590A3AA82A06F
1 changed files with 7 additions and 1 deletions

View File

@ -215,8 +215,14 @@ local function statusline_focused()
end
local function statusline_not_focused()
local bufnr = vim.fn.winbufnr(vim.g.statusline_winid)
local file = vim.fn.expand("#" .. bufnr .. ":p:~")
local winwidth = vim.fn.winwidth(0)
return table.concat {
gen_section("%#StatuslineNF#", { "%f", "%m" }),
gen_section("%#StatuslineNF#", {
shorten_path(file, winwidth / 3),
"%m"
}),
"%=",
gen_section("%#StatuslineNF#", { "%03.p%%" }),
gen_section("%#StatuslineNF#", { "-%03.c-" })