diff options
| author | Jongwook Choi <wookayin@gmail.com> | 2023-09-19 17:20:26 -0400 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2024-02-11 11:21:29 +0100 |
| commit | 9860fceb73eb85a9ad424513fe163e6506dfb1fd (patch) | |
| tree | 0b4e7e106ea5e0f4dd146936d7f577fdb051964e /lua | |
| parent | Update parsers: bash, cpp, dart, gitattributes, hyprlang, ruby, wing, zathurarc (diff) | |
| download | nvim-treesitter-9860fceb73eb85a9ad424513fe163e6506dfb1fd.tar nvim-treesitter-9860fceb73eb85a9ad424513fe163e6506dfb1fd.tar.gz nvim-treesitter-9860fceb73eb85a9ad424513fe163e6506dfb1fd.tar.bz2 nvim-treesitter-9860fceb73eb85a9ad424513fe163e6506dfb1fd.tar.lz nvim-treesitter-9860fceb73eb85a9ad424513fe163e6506dfb1fd.tar.xz nvim-treesitter-9860fceb73eb85a9ad424513fe163e6506dfb1fd.tar.zst nvim-treesitter-9860fceb73eb85a9ad424513fe163e6506dfb1fd.zip | |
fix: use augroup for auto_install autocmds
Problem: The FileType autocmd to automatically install parsers on a new
filetype (introduced in #3130) did not have augroup. As a result, when
`ts_configs.setup{ }` is called multiple times (for some reason),
duplicated installation requests will be made.
Solution: Use augroup with `clear = true`.
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim-treesitter/install.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 82d233e20..0a7a9ae3d 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -555,6 +555,7 @@ end function M.setup_auto_install() vim.api.nvim_create_autocmd("FileType", { pattern = { "*" }, + group = vim.api.nvim_create_augroup("NvimTreesitter-auto_install", { clear = true }), callback = function() local lang = parsers.get_buf_lang() if parsers.get_parser_configs()[lang] and not is_installed(lang) and not is_ignored_parser(lang) then |
