Merge branch 'dev' into mercury
nvim: fix shortened path in statusline for unfocused buffers
This commit is contained in:
commit
f8b91f7e16
@ -215,8 +215,14 @@ local function statusline_focused()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function statusline_not_focused()
|
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 {
|
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.p%%" }),
|
||||||
gen_section("%#StatuslineNF#", { "-%03.c-" })
|
gen_section("%#StatuslineNF#", { "-%03.c-" })
|
||||||
|
Reference in New Issue
Block a user