Skip to content

Commit 5e1b21c

Browse files
committed
Replace vim function with lua code
1 parent 55cfe81 commit 5e1b21c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lua/pretty-fold/init.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ local function fold_text(config)
7070
end
7171

7272
-- Calculate widths of the number column.
73-
local num_col_width = math.max( fn.strlen(fn.line('$')), wo.numberwidth )
73+
local num_col_width = math.max( #tostring(api.nvim_buf_line_count(0)),
74+
wo.numberwidth )
7475

7576
-- We can't calculate precisely the current foldcolumn width.
7677
-- So we assume it has the maximum value taken from 'foldcolumn' option ...

0 commit comments

Comments
 (0)