From 2692808eca8a4ac3311516a1c4a14bb97ecc6482 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Mon, 10 Jun 2024 16:26:20 -0500 Subject: [PATCH] fix: ensure rename works when switching buffers Related to #189 --- lua/nvim-ts-autotag/internal.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/nvim-ts-autotag/internal.lua b/lua/nvim-ts-autotag/internal.lua index efe5892..1c6d08d 100644 --- a/lua/nvim-ts-autotag/internal.lua +++ b/lua/nvim-ts-autotag/internal.lua @@ -485,9 +485,12 @@ M.attach = function(bufnr) }) end if Setup.get_opts(vim.bo.filetype).enable_rename then + -- HACK: This does not bind to a specific buffer, unfortunately it seems doing so will + -- break rename when switching between different buffers. Making it *not* bind to a + -- specific buffer shouldn't cause any problems in theory. Ideally it would be bound per + -- buffer, but for now this works (and I'm lazy). vim.api.nvim_create_autocmd("InsertLeave", { group = group, - buffer = bufnr, callback = M.rename_tag, }) end