mirror of
https://github.com/windwp/nvim-ts-autotag.git
synced 2025-01-01 13:59:13 -06:00
Detach the currently effective buffer number
This commit is contained in:
parent
32bc46ee8b
commit
5bbdfdaa30
@ -1,5 +1,4 @@
|
||||
|
||||
local internal= require('nvim-ts-autotag.internal')
|
||||
local internal = require("nvim-ts-autotag.internal")
|
||||
|
||||
local M = {}
|
||||
|
||||
@ -19,7 +18,7 @@ function M.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 * call v:lua.require('nvim-ts-autotag.internal').detach()]]
|
||||
vim.cmd[[autocmd BufDelete * lua require('nvim-ts-autotag.internal').detach(vim.fn.expand('<abuf>'))]]
|
||||
vim.cmd[[augroup end]]
|
||||
end
|
||||
|
||||
|
@ -426,8 +426,8 @@ M.attach = function (bufnr,lang)
|
||||
end
|
||||
end
|
||||
|
||||
M.detach = function ( )
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
M.detach = function (bufnr)
|
||||
bufnr = tonumber(bufnr) or vim.api.nvim_get_current_buf()
|
||||
buffer_tag[bufnr] = nil
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user