Compare commits

..

1 Commits

Author SHA1 Message Date
6be773e6e9
feat!: overhaul the config setup
This deprecates the old setup layout

Closes https://github.com/PriceHiller/nvim-ts-autotag/issues/5
2024-05-15 08:25:29 -05:00
2 changed files with 4 additions and 8 deletions

View File

@ -139,7 +139,7 @@ local Setup = {
per_filetype = {},
}
--- Do general plugin setup
--- Do general plugin setup. Can be called multiple times to override values piecemeal.
---@param opts nvim-ts-autotag.PluginSetup
function Setup.setup(opts)
if Setup.did_setup then
@ -147,7 +147,8 @@ function Setup.setup(opts)
end
if opts and not opts.opts then
vim.notify(
"nvim-ts-autotag: Using the legacy setup opts! Please migrate to the new setup options layout as this will eventually have its support removed in 1.0.0!",
"nvim-ts-autotag: Using the legacy setup opts! Please migrate to the new setup options layout as this will eventually have its support removed in 1.0.0!"
.. vim.inspect(Setup.did_setup),
vim.log.levels.WARN
)
opts = {

View File

@ -443,12 +443,7 @@ end
M.attach = function(bufnr)
bufnr = bufnr or vim.api.nvim_get_current_buf()
if not Setup.did_setup then
local _, ts_configs = pcall(require, "nvim-treesitter.configs")
if not ts_configs then
M.setup({ opts = {} })
end
local config = ts_configs.get_module("autotag")
local config = require("nvim-treesitter.configs").get_module("autotag")
Setup.setup(config)
end