diff options
| author | kiyan42 <yazdani.kiyan@protonmail.com> | 2020-06-29 14:46:25 +0200 |
|---|---|---|
| committer | Thomas Vigouroux <39092278+vigoux@users.noreply.github.com> | 2020-06-29 17:18:22 +0200 |
| commit | 7f6f7596dac5a45ae914336dc986ebb30881b1a3 (patch) | |
| tree | 4570e65eca2f5ad56261fcff992f17336b2b5604 /lua/nvim-treesitter.lua | |
| parent | Extend documentation for TSError (diff) | |
| download | nvim-treesitter-7f6f7596dac5a45ae914336dc986ebb30881b1a3.tar nvim-treesitter-7f6f7596dac5a45ae914336dc986ebb30881b1a3.tar.gz nvim-treesitter-7f6f7596dac5a45ae914336dc986ebb30881b1a3.tar.bz2 nvim-treesitter-7f6f7596dac5a45ae914336dc986ebb30881b1a3.tar.lz nvim-treesitter-7f6f7596dac5a45ae914336dc986ebb30881b1a3.tar.xz nvim-treesitter-7f6f7596dac5a45ae914336dc986ebb30881b1a3.tar.zst nvim-treesitter-7f6f7596dac5a45ae914336dc986ebb30881b1a3.zip | |
add used_by key to parsers
Enables the use of multiple filetypes for one parser.
Diffstat (limited to 'lua/nvim-treesitter.lua')
| -rw-r--r-- | lua/nvim-treesitter.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lua/nvim-treesitter.lua b/lua/nvim-treesitter.lua index 9b3ddce89..553ec3f65 100644 --- a/lua/nvim-treesitter.lua +++ b/lua/nvim-treesitter.lua @@ -17,9 +17,10 @@ function M.setup() for _, lang in pairs(parsers.available_parsers()) do for _, mod in pairs(configs.available_modules()) do if configs.is_enabled(mod, lang) then - local ft = parsers.lang_to_ft(lang) local cmd = string.format("lua require'nvim-treesitter.%s'.attach()", mod) - api.nvim_command(string.format("autocmd NvimTreesitter FileType %s %s", ft, cmd)) + for _, ft in pairs(parsers.lang_to_ft(lang)) do + api.nvim_command(string.format("autocmd NvimTreesitter FileType %s %s", ft, cmd)) + end end end end |
