feat: add padding to title (#138)

This commit is contained in:
yetone 2024-08-21 23:22:34 +08:00 committed by GitHub
parent f95feebd39
commit 8a62e3e225
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -330,6 +330,9 @@ function Sidebar:do_render_header(winid, bufnr, header_text, hl, reverse_hl)
if not bufnr or not api.nvim_buf_is_valid(bufnr) then if not bufnr or not api.nvim_buf_is_valid(bufnr) then
return return
end end
header_text = " " .. header_text .. " "
local width = api.nvim_win_get_width(winid) local width = api.nvim_win_get_width(winid)
local header_text_length = vim.fn.strdisplaywidth(header_text) local header_text_length = vim.fn.strdisplaywidth(header_text)
local prefix_padding, suffix_padding = 0, 0 local prefix_padding, suffix_padding = 0, 0