mirror of
https://github.com/neovim/neovim.git
synced 2026-04-20 14:25:32 +00:00
fix(treesitter): ensure syntaxset augroup exists (#29542)
Problem: Error when calling vim.treesitter.start() and vim.treesitter.stop() in init.lua. Solution: Ensure syntaxset augroup exists after loading synload.vim.
This commit is contained in:
@@ -139,8 +139,11 @@ function TSHighlighter.new(tree, opts)
|
||||
-- but use synload.vim rather than syntax.vim to not enable
|
||||
-- syntax FileType autocmds. Later on we should integrate with the
|
||||
-- `:syntax` and `set syntax=...` machinery properly.
|
||||
-- Still need to ensure that syntaxset augroup exists, so that calling :destroy()
|
||||
-- immediately afterwards will not error.
|
||||
if vim.g.syntax_on ~= 1 then
|
||||
vim.cmd.runtime({ 'syntax/synload.vim', bang = true })
|
||||
vim.api.nvim_create_augroup('syntaxset', { clear = false })
|
||||
end
|
||||
|
||||
vim._with({ buf = self.bufnr }, function()
|
||||
|
||||
Reference in New Issue
Block a user