File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ M.is_supported = function(lang)
2222end
2323
2424local buffer_tag = {}
25+ local autocmd = {}
2526
2627local setup_ts_tag = function ()
2728 local bufnr = vim .api .nvim_get_current_buf ()
@@ -497,7 +498,7 @@ M.attach = function(bufnr)
497498 })
498499 end
499500 if Setup .get_opts (vim .bo .filetype ).enable_rename then
500- vim .api .nvim_create_autocmd (" InsertLeave" , {
501+ autocmd [ bufnr ] = vim .api .nvim_create_autocmd (" InsertLeave" , {
501502 group = group ,
502503 buffer = bufnr ,
503504 callback = M .rename_tag ,
509510M .detach = function (bufnr )
510511 bufnr = tonumber (bufnr ) or vim .api .nvim_get_current_buf ()
511512 buffer_tag [bufnr ] = nil
513+ pcall (vim .keymap .del , " i" , " >" , { buffer = bufnr })
514+ pcall (vim .keymap .del , " i" , " /" , { buffer = bufnr })
515+ if autocmd [bufnr ] then
516+ pcall (vim .api .nvim_del_autocmd , autocmd [bufnr ])
517+ autocmd [bufnr ] = nil
518+ end
512519end
513520
514521-- _G.AUTO = M
You can’t perform that action at this time.
0 commit comments