Skip to content

Commit

Permalink
fix: map Insertleave by buffer.
Browse files Browse the repository at this point in the history
  • Loading branch information
windwp committed Jul 7, 2024
1 parent ddfccbf commit 323a3e1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lua/nvim-ts-autotag/internal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ M.attach = function(bufnr)

if TagConfigs:get(vim.bo.filetype) ~= nil then
setup_ts_tag()
local group = vim.api.nvim_create_augroup("nvim-ts-autotag", { clear = true })
local group = vim.api.nvim_create_augroup("nvim-ts-autotag-" .. bufnr, { clear = true })
if Setup.get_opts(vim.bo.filetype).enable_close then
vim.keymap.set("i", ">", function()
local row, col = unpack(vim.api.nvim_win_get_cursor(0))
Expand Down Expand Up @@ -485,12 +485,9 @@ 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 323a3e1

Please sign in to comment.