mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 07:16:09 +00:00
fix(treesitter): create new parser if language is not the same as cached parser (#18149)
This commit is contained in:
@@ -90,7 +90,7 @@ function M.get_parser(bufnr, lang, opts)
|
||||
lang = a.nvim_buf_get_option(bufnr, "filetype")
|
||||
end
|
||||
|
||||
if parsers[bufnr] == nil then
|
||||
if parsers[bufnr] == nil or parsers[bufnr]:lang() ~= lang then
|
||||
parsers[bufnr] = M._create_parser(bufnr, lang, opts)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user