diff --git a/lua/nvim-ts-autotag/internal.lua b/lua/nvim-ts-autotag/internal.lua index de8e110..4bc73c0 100644 --- a/lua/nvim-ts-autotag/internal.lua +++ b/lua/nvim-ts-autotag/internal.lua @@ -330,11 +330,13 @@ M.close_tag = function() buf_parser:parse() local result, tag_name = check_close_tag() if result == true and tag_name ~= nil then - vim.cmd(string.format([[normal! a]], tag_name)) - vim.cmd([[normal! F>]]) - end + vim.api.nvim_put({string.format("", tag_name)}, "", true, false) + vim.cmd([[normal! F>]]) + end end + + local function replace_text_node(node, tag_name) if node == nil then return