feat(fold): show number of folded lines in foldtext

This commit is contained in:
Phúc Lê Khắc 2023-10-30 10:38:08 +01:00
parent a50f92f755
commit 12003a5572

View file

@ -78,7 +78,8 @@ function M.foldtext()
if not ret or type(ret) == "string" then
ret = { { vim.api.nvim_buf_get_lines(0, vim.v.lnum - 1, vim.v.lnum, false)[1], {} } }
end
table.insert(ret, { " " .. require("lazyvim.config").icons.misc.dots })
local num_lines = " [" .. vim.v.foldend - vim.v.foldstart .. " lines]"
table.insert(ret, { " " .. require("lazyvim.config").icons.misc.dots .. num_lines, { "CursorColumn" }})
if not vim.treesitter.foldtext then
return table.concat(