From ef0cd56e482bf82be82afd6afc69268fc6037475 Mon Sep 17 00:00:00 2001 From: coinator Date: Sat, 7 Jan 2023 14:23:00 +0100 Subject: Remove update_selection side-effects (#4114) --- lua/nvim-treesitter/ts_utils.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lua') diff --git a/lua/nvim-treesitter/ts_utils.lua b/lua/nvim-treesitter/ts_utils.lua index bfe6170b1..f0409d66d 100644 --- a/lua/nvim-treesitter/ts_utils.lua +++ b/lua/nvim-treesitter/ts_utils.lua @@ -288,7 +288,8 @@ function M.update_selection(buf, node, selection_mode) -- "gv": Start Visual mode with the same area as the previous area and the same mode. -- Hence, area will be what we defined in "<" and ">" marks. We only feed `selection_mode` if it is -- different than previous `visualmode`, otherwise it will stop visual mode. - api.nvim_feedkeys("gv" .. selection_mode, "x", false) + -- bang=true is provided to avoid gv side-effects + api.nvim_cmd({ cmd = "normal", bang = true, args = { "gv" .. selection_mode } }, {}) end -- Byte length of node range -- cgit v1.2.3-70-g09d2