plugins/treesitter: remove vim.cmd hack

This commit is contained in:
diniamo 2024-07-13 18:02:46 +02:00
parent 2433d4b720
commit 714f006a34

View file

@ -37,11 +37,10 @@ in {
}; };
# For some reason treesitter highlighting does not work on start if this is set before syntax on # For some reason treesitter highlighting does not work on start if this is set before syntax on
# HACK: is there a way to convert the foldexpr line to lua?
luaConfigRC.treesitter-fold = mkIf cfg.fold (entryBefore ["basic"] '' luaConfigRC.treesitter-fold = mkIf cfg.fold (entryBefore ["basic"] ''
-- This is required by treesitter-context to handle folds -- This is required by treesitter-context to handle folds
vim.o.foldmethod = "expr" vim.o.foldmethod = "expr"
vim.cmd("set foldexpr=nvim_treesitter#foldexpr())" vim.o.foldexpr = "nvim_treesitter#foldexpr()"
-- This is optional, but is set rather as a sane default. -- This is optional, but is set rather as a sane default.
-- If unset, opened files will be folded by automatically as -- If unset, opened files will be folded by automatically as