We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 730bda9 commit a282ec7Copy full SHA for a282ec7
lua/astroui/folding.lua
@@ -18,9 +18,7 @@ local fold_methods = {
18
if lsp_bufs[bufnr or vim.api.nvim_get_current_buf()] then return vim.lsp.foldexpr(lnum) end
19
end,
20
treesitter = function(lnum, bufnr)
21
- if vim.bo.filetype and vim.treesitter.get_parser(bufnr, nil, { error = false }) then
22
- return vim.treesitter.foldexpr(lnum)
23
- end
+ if vim.bo.filetype and pcall(vim.treesitter.get_parser, bufnr) then return vim.treesitter.foldexpr(lnum) end
24
25
indent = function(lnum, bufnr)
26
if not lnum then lnum = vim.v.lnum end
0 commit comments