nvim: statusline: Do not set winbar for empty filename

This commit is contained in:
Sanchayan Maity 2024-04-12 20:26:03 +05:30
parent cd50d8f956
commit 6617280944
Signed by: sanchayanmaity
GPG Key ID: 6F6A0609C12038F3
1 changed files with 3 additions and 1 deletions

View File

@ -297,7 +297,9 @@ api.nvim_create_autocmd({"BufWinEnter", "BufFilePost"}, {
-- `:.` Reduces file name to be relative to current directory, if possible.
local winbar_file = vim.fn.expand('%:.')
vim.opt_local.winbar = string.format(" %s%s", "%#WinbarFile#", winbar_file)
if winbar_file ~= '' then
vim.opt_local.winbar = string.format(" %s%s", "%#WinbarFile#", winbar_file)
end
end,
})
api.nvim_create_autocmd({"TermOpen", "TermEnter"}, {