fix: lineno left prefix padding

This commit is contained in:
hedy
2023-11-13 15:20:54 +08:00
parent df8f24a52a
commit 60e8cadb46

View File

@@ -121,8 +121,7 @@ function M.make_outline(bufnr, items)
-- Find the prefix for each line needed for the lineno space -- Find the prefix for each line needed for the lineno space
local lineno_offset = 0 local lineno_offset = 0
local lineno_prefix = "" local lineno_prefix = ""
-- FIXME: Why is the +1 at the end needed? (Otherwise numbers are misaligned) local lineno_max_width = #tostring(vim.api.nvim_buf_line_count(bufnr) - 1)
local lineno_max_width = #tostring(vim.api.nvim_buf_line_count(bufnr) - 1) + 1
if cfg.o.outline_items.show_symbol_lineno then if cfg.o.outline_items.show_symbol_lineno then
-- Use max width-1 plus 1 space padding. -- Use max width-1 plus 1 space padding.
-- -1 because if max_width is a power of ten, don't shift the entire lineno -- -1 because if max_width is a power of ten, don't shift the entire lineno