Skip to content

Commit be14e14

Browse files
committed
commit
1 parent 08a1651 commit be14e14

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lua/easycomplete/cmdline.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,13 @@ function this.calculate_sign_and_linenr_width()
6969
if vim.wo.number or vim.wo.relativenumber then
7070
-- 计算行号的最大宽度
7171
local max_num_width = #tostring(vim.fn.line("$"))
72-
width = width + max_num_width
72+
local realwidth = 3
73+
if max_num_width <= 3 then
74+
-- do nothing
75+
else
76+
realwidth = realwidth + (max_num_width - 3)
77+
end
78+
width = width + realwidth
7379
end
7480
return width
7581
end

0 commit comments

Comments
 (0)