diff options
| author | coinator <mattvass95@gmail.com> | 2023-01-07 14:23:00 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-07 14:23:00 +0100 |
| commit | ef0cd56e482bf82be82afd6afc69268fc6037475 (patch) | |
| tree | 8aac757953bd61b0dad28a487c4c03528b0e6c9b | |
| parent | allow negative assertion in injection tests (#4107) (diff) | |
| download | nvim-treesitter-ef0cd56e482bf82be82afd6afc69268fc6037475.tar nvim-treesitter-ef0cd56e482bf82be82afd6afc69268fc6037475.tar.gz nvim-treesitter-ef0cd56e482bf82be82afd6afc69268fc6037475.tar.bz2 nvim-treesitter-ef0cd56e482bf82be82afd6afc69268fc6037475.tar.lz nvim-treesitter-ef0cd56e482bf82be82afd6afc69268fc6037475.tar.xz nvim-treesitter-ef0cd56e482bf82be82afd6afc69268fc6037475.tar.zst nvim-treesitter-ef0cd56e482bf82be82afd6afc69268fc6037475.zip | |
Remove update_selection side-effects (#4114)
| -rw-r--r-- | lua/nvim-treesitter/ts_utils.lua | 3 |
1 files changed, 2 insertions, 1 deletions
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 |
