mirror of
https://github.com/neovim/neovim.git
synced 2026-07-14 05:10:36 +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.
(cherry picked from commit d413038b4f)
This commit is contained in:
committed by
github-actions[bot]
parent
803cc08c17
commit
356ddb1305
@@ -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
|
||||
|
||||
api.nvim_buf_call(self.bufnr, function()
|
||||
|
||||
Reference in New Issue
Block a user