From 23b45422188c88101e92b5227144783bdb782a76 Mon Sep 17 00:00:00 2001 From: Stephan Seitz Date: Mon, 31 Aug 2020 18:31:15 +0200 Subject: fix(highlight_current_scope): Ensure that detach is a inverse of attach --- lua/nvim-treesitter/refactor/highlight_current_scope.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lua') diff --git a/lua/nvim-treesitter/refactor/highlight_current_scope.lua b/lua/nvim-treesitter/refactor/highlight_current_scope.lua index ef695f7b9..e45286152 100644 --- a/lua/nvim-treesitter/refactor/highlight_current_scope.lua +++ b/lua/nvim-treesitter/refactor/highlight_current_scope.lua @@ -37,8 +37,8 @@ function M.attach(bufnr) end function M.detach(bufnr) - M.clear_usage_highlights(bufnr) - cmd(string.format('autocmd! NvimTreesitterCurrentScope_%d CursorHold', bufnr)) + M.clear_highlights(bufnr) + cmd(string.format('autocmd! NvimTreesitterCurrentScope_%d CursorMoved', bufnr)) cmd(string.format('autocmd! NvimTreesitterCurrentScope_%d BufLeave', bufnr)) end -- cgit v1.2.3-70-g09d2