Skip to content

Commit

Permalink
fix(options): only enable treesitter foldexpr on nightly. Fixes #1581
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 4, 2023
1 parent 3849e01 commit d989ecc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/lazyvim/config/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,13 @@ vim.opt.foldlevel = 99
vim.opt.foldtext = "v:lua.require'lazyvim.util.ui'.foldtext()"

if vim.fn.has("nvim-0.9.0") == 1 then
vim.opt.statuscolumn = [[%!v:lua.require'lazyvim.util.ui'.statuscolumn()]]
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.statuscolumn = [[%!v:lua.require'lazyvim.util.ui'.statuscolumn()]]
else
vim.opt.foldmethod = "indent"
end
Expand Down

0 comments on commit d989ecc

Please sign in to comment.