2022-02-03 22:24:23 -06:00
|
|
|
local internal = require("nvim-ts-autotag.internal")
|
2021-03-10 00:09:41 -06:00
|
|
|
|
|
|
|
local M = {}
|
|
|
|
|
|
|
|
function M.init()
|
2024-05-18 08:18:45 -05:00
|
|
|
local ts = require('nvim-treesitter')
|
|
|
|
if ts and ts.define_modules then
|
|
|
|
require('nvim-treesitter').define_modules({
|
|
|
|
autotag = {
|
|
|
|
module_path = 'nvim-ts-autotag.internal',
|
|
|
|
is_supported = function(lang)
|
|
|
|
return internal.is_supported(lang)
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
})
|
|
|
|
end
|
2021-03-10 00:09:41 -06:00
|
|
|
end
|
|
|
|
|
|
|
|
function M.setup(opts)
|
2024-05-19 07:01:00 -05:00
|
|
|
internal.setup(opts)
|
|
|
|
vim.cmd([[augroup nvim_ts_xmltag]])
|
|
|
|
vim.cmd([[autocmd!]])
|
|
|
|
vim.cmd([[autocmd FileType * call v:lua.require('nvim-ts-autotag.internal').attach()]])
|
|
|
|
vim.cmd([[autocmd BufDelete * lua require('nvim-ts-autotag.internal').detach(vim.fn.expand('<abuf>'))]])
|
|
|
|
vim.cmd([[augroup end]])
|
2021-03-10 00:09:41 -06:00
|
|
|
end
|
|
|
|
|
|
|
|
return M
|