mirror of
https://github.com/windwp/nvim-ts-autotag.git
synced 2024-12-30 14:09:14 -06:00
refactor: pcall require on nvim-treesitter.configs
`nvim-treesitter.configs` is going to be removed soon -- directly requiring it will cause an error once it has been removed.
This commit is contained in:
parent
08e9ada208
commit
971547b9ac
@ -443,7 +443,12 @@ end
|
||||
M.attach = function(bufnr)
|
||||
bufnr = bufnr or vim.api.nvim_get_current_buf()
|
||||
if not Setup.did_setup then
|
||||
local config = require("nvim-treesitter.configs").get_module("autotag")
|
||||
local _, ts_configs = pcall(require, "nvim-treesitter.configs")
|
||||
if not ts_configs then
|
||||
M.setup({ opts = {} })
|
||||
end
|
||||
|
||||
local config = ts_configs.get_module("autotag")
|
||||
Setup.setup(config)
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user