File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ opt.foldexpr = "v:lua.LazyVim.treesitter.foldexpr()" -- treesitter folds
124124opt .foldlevel = 99
125125opt .foldmethod = " expr"
126126opt .foldtext = " "
127- opt .formatexpr = " v:lua.require'lazyvim.util' .format.formatexpr()"
127+ opt .formatexpr = " v:lua.LazyVim .format.formatexpr()"
128128opt .formatoptions = " jcroqlnt" -- tcqj
129129opt .grepformat = " %f:%l:%c:%m"
130130opt .grepprg = " rg --vimgrep"
Original file line number Diff line number Diff line change @@ -131,9 +131,18 @@ opts = {
131131
132132 -- treesitter highlighting
133133 vim .api .nvim_create_autocmd (" FileType" , {
134+ group = vim .api .nvim_create_augroup (" lazyvim_treesitter" , { clear = true }),
134135 callback = function (ev )
135136 if LazyVim .treesitter .have (ev .match ) then
136137 pcall (vim .treesitter .start )
138+
139+ -- check if ftplugins changed foldexpr/indentexpr
140+ for _ , option in ipairs ({ " foldexpr" , " indentexpr" }) do
141+ local expr = " v:lua.LazyVim.treesitter." .. option .. " ()"
142+ if vim .opt_global [option ]:get () == expr then
143+ vim .opt_local [option ] = expr
144+ end
145+ end
137146 end
138147 end ,
139148 })
You can’t perform that action at this time.
0 commit comments