diff options
| author | Thomas Vigouroux <39092278+vigoux@users.noreply.github.com> | 2020-04-25 21:44:44 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-25 21:44:44 +0200 |
| commit | 2ca0c348f73655b395ded2e60e13ba0c2249dc74 (patch) | |
| tree | cebdee86382940748cc71c24afde455e3655d6e2 /lua/nvim-treesitter.lua | |
| parent | Merge pull request #18 from kyazdani42/improve-configs (diff) | |
| parent | fix: config is enabled also checks parser existence (diff) | |
| download | nvim-treesitter-2ca0c348f73655b395ded2e60e13ba0c2249dc74.tar nvim-treesitter-2ca0c348f73655b395ded2e60e13ba0c2249dc74.tar.gz nvim-treesitter-2ca0c348f73655b395ded2e60e13ba0c2249dc74.tar.bz2 nvim-treesitter-2ca0c348f73655b395ded2e60e13ba0c2249dc74.tar.lz nvim-treesitter-2ca0c348f73655b395ded2e60e13ba0c2249dc74.tar.xz nvim-treesitter-2ca0c348f73655b395ded2e60e13ba0c2249dc74.tar.zst nvim-treesitter-2ca0c348f73655b395ded2e60e13ba0c2249dc74.zip | |
Merge pull request #26 from kyazdani42/fix/config-isenabled
fix: config is enabled also checks parser existence
Diffstat (limited to 'lua/nvim-treesitter.lua')
| -rw-r--r-- | lua/nvim-treesitter.lua | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lua/nvim-treesitter.lua b/lua/nvim-treesitter.lua index 731f55e5d..e1c95ed31 100644 --- a/lua/nvim-treesitter.lua +++ b/lua/nvim-treesitter.lua @@ -1,5 +1,4 @@ local api = vim.api -local parsers = require'nvim-treesitter.parsers' local install = require'nvim-treesitter.install' local locals = require'nvim-treesitter.locals' local utils = require'nvim-treesitter.utils' @@ -17,7 +16,7 @@ function M.setup(lang) for _, ft in pairs(configs.available_parsers()) do for _, mod in pairs(configs.available_modules()) do - if parsers.has_parser(ft) and configs.is_enabled(mod, ft) then + if configs.is_enabled(mod, ft) then local cmd = string.format("lua require'nvim-treesitter.%s'.attach()", mod) api.nvim_command(string.format("autocmd FileType %s %s", ft, cmd)) end |
