perf(ui): never show folds on dashboards

This commit is contained in:
Folke Lemaitre
2024-11-18 21:27:34 +01:00
parent 33557ae68b
commit 0352f944c3

View File

@ -15,7 +15,11 @@ function M.foldexpr()
if vim.bo[buf].filetype == "" then
return "0"
end
vim.b[buf].ts_folds = pcall(vim.treesitter.get_parser, buf)
if vim.bo[buf].filetype:find("dashboard") then
vim.b[buf].ts_folds = false
else
vim.b[buf].ts_folds = pcall(vim.treesitter.get_parser, buf)
end
end
return vim.b[buf].ts_folds and vim.treesitter.foldexpr() or "0"
end