[nvim] fix: shorten filenames in unfocused buffers
786d119 shortened the filename for the current buffer, but didn't change the filename in other buffers
This commit is contained in:
parent
786d119e5c
commit
cdd3b50248
@ -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-" })
|
||||
|
Reference in New Issue
Block a user