mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-16 04:14:37 +02:00
perf(ui): wrap treesitter.foldexpr and cache get_parser during a event loop tick. Fixes #1846
This commit is contained in:
parent
99598ef7c7
commit
a5c9708736
2 changed files with 39 additions and 1 deletions
|
@ -82,7 +82,7 @@ end
|
|||
-- HACK: causes freezes on <= 0.9, so only enable on >= 0.10 for now
|
||||
if vim.fn.has("nvim-0.10") == 1 then
|
||||
vim.opt.foldmethod = "expr"
|
||||
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||
vim.opt.foldexpr = "v:lua.require'lazyvim.util'.ui.foldexpr()"
|
||||
else
|
||||
vim.opt.foldmethod = "indent"
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue