Skip to content

Commit

Permalink
fix: ensure rename works when switching buffers
Browse files Browse the repository at this point in the history
Related to #189
  • Loading branch information
PriceHiller committed Jun 10, 2024
1 parent e050642 commit 2692808
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/nvim-ts-autotag/internal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2692808

Please sign in to comment.