Skip to content

Commit 882e58c

Browse files
committed
fix: fallback to syntax if treesitter parser is not available
1 parent 2eb646f commit 882e58c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lua/noice/view/init.lua

+3-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ function View:render(buf, opts)
201201
end
202202

203203
if self._opts.lang and not vim.b[buf].ts_highlight then
204-
pcall(vim.treesitter.start, buf, self._opts.lang)
204+
if not pcall(vim.treesitter.start, buf, self._opts.lang) then
205+
vim.bo[buf].syntax = self._opts.lang
206+
end
205207
end
206208

207209
vim.api.nvim_buf_clear_namespace(buf, Config.ns, linenr - 1, -1)

0 commit comments

Comments
 (0)