mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat: allow hot-reloading parser after installation
This commit is contained in:
parent
f0a1c3df24
commit
7c9ddb72d1
1 changed files with 1 additions and 0 deletions
|
|
@ -387,6 +387,7 @@ local function run_install(cache_folder, install_folder, lang, repo, with_sync,
|
|||
cmd = function()
|
||||
for _, buf in ipairs(vim.api.nvim_list_bufs()) do
|
||||
if parsers.get_buf_lang(buf) == lang then
|
||||
vim._ts_remove_language(lang)
|
||||
vim.treesitter.language.require_language(lang)
|
||||
for _, mod in ipairs(require("nvim-treesitter.configs").available_modules()) do
|
||||
require("nvim-treesitter.configs").reattach_module(mod, buf)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue