From 8619a63750c33f3439f7100367a4795ea67a4f62 Mon Sep 17 00:00:00 2001 From: soufiane nassih Date: Thu, 25 Jan 2024 10:17:01 +0100 Subject: [PATCH] Detach affected buffer only. (#144) --- lua/nvim-ts-autotag/internal.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/nvim-ts-autotag/internal.lua b/lua/nvim-ts-autotag/internal.lua index bab1345..51a192e 100644 --- a/lua/nvim-ts-autotag/internal.lua +++ b/lua/nvim-ts-autotag/internal.lua @@ -594,8 +594,8 @@ M.attach = function(bufnr, lang) end end -M.detach = function() - local bufnr = vim.api.nvim_get_current_buf() +M.detach = function(bufnr) + local bufnr = tonumber(bufnr) or vim.api.nvim_get_current_buf() buffer_tag[bufnr] = nil end