File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
lua/nvim-treesitter-textobjects Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -43,12 +43,16 @@ M.repeat_last_move = function(opts_extend)
4343 return
4444 end
4545 local opts = vim .tbl_deep_extend (' force' , M .last_move .opts , opts_extend or {})
46+ -- The call to `normal` in `force_operator_pending_visual_mode` resets `vim.v.count1` to 1 while in
47+ -- operator-pending (no) mode. Meaning, that the `vim.v.count1` must be saved before the
48+ -- `force_operator_pending_visual_mode` call and used later on instead of new `vim.v.count1`.
49+ local count1 = vim .v .count1
4650 if M .last_move .func == ' f' or M .last_move .func == ' t' then
4751 force_operator_pending_visual_mode ()
48- vim .cmd ([[ normal! ]] .. vim . v . count1 .. (opts .forward and ' ;' or ' ,' ))
52+ vim .cmd ([[ normal! ]] .. count1 .. (opts .forward and ' ;' or ' ,' ))
4953 elseif M .last_move .func == ' F' or M .last_move .func == ' T' then
5054 force_operator_pending_visual_mode ()
51- vim .cmd ([[ normal! ]] .. vim . v . count1 .. (opts .forward and ' ,' or ' ;' ))
55+ vim .cmd ([[ normal! ]] .. count1 .. (opts .forward and ' ,' or ' ;' ))
5256 else
5357 -- we assume other textobjects (move) already handle operator-pending mode correctly
5458 M .last_move .func (opts , unpack (M .last_move .additional_args ))
You can’t perform that action at this time.
0 commit comments