mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-21 16:39:06 +02:00
perf(ui): only enable treesitter folds if the buffer has treesitter highlighting
This commit is contained in:
parent
24665fc736
commit
b9dae57961
1 changed files with 5 additions and 0 deletions
|
@ -53,6 +53,11 @@ local skip_check = assert(vim.uv.new_check())
|
|||
function M.foldexpr()
|
||||
local buf = vim.api.nvim_get_current_buf()
|
||||
|
||||
-- no highlight, no foldexpr
|
||||
if not vim.b[buf].ts_highlight then
|
||||
return "0"
|
||||
end
|
||||
|
||||
-- still in the same tick and no parser
|
||||
if M.skip_foldexpr[buf] then
|
||||
return "0"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue