File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -354,9 +354,11 @@ H.make_expr_jump = function(backward, till)
354354 return function ()
355355 if H .is_disabled () then return ' ' end
356356
357- -- Always ask for `target` as this will be used only in operator-pending
358- -- mode. Dot-repeat will be implemented via expression-mapping.
359- local target = H .get_target ()
357+ -- Ask for `target` for non-repeating jump as this will be used only in
358+ -- operator-pending mode. Dot-repeat is supported via expression-mapping.
359+ local is_repeat_jump = backward == nil or till == nil
360+ local target = is_repeat_jump and MiniJump .state .target or H .get_target ()
361+
360362 -- Stop if user supplied invalid target
361363 if target == nil then return ' <Esc>' end
362364 H .update_state (target , backward , till , vim .v .count1 )
Original file line number Diff line number Diff line change @@ -811,7 +811,7 @@ T['Repeat jump with ;']['works in Normal and Visual mode'] = new_set({
811811 end ,
812812})
813813
814- T [' Repeat jump with ;' ][' works in Operator-pending mode' ] = function ()
814+ T [' Repeat jump with ;' ][' works after jump in Operator-pending mode' ] = function ()
815815 -- It doesn't repeat actual operation, just performs same jump
816816 set_lines ({ ' 1e2e3e4e5e' })
817817 set_cursor (1 , 0 )
@@ -829,6 +829,16 @@ T['Repeat jump with ;']['works in Operator-pending mode'] = function()
829829 eq (get_cursor (), { 1 , 3 })
830830end
831831
832+ T [' Repeat jump with ;' ][' works in Operator-pending mode' ] = function ()
833+ set_lines ({ ' 1e2e3e4e5e' })
834+ set_cursor (1 , 0 )
835+
836+ -- Should repeat without asking for target
837+ type_keys (' f' , ' e' , ' d' , ' ;' )
838+ eq (get_lines (), { ' 13e4e5e' })
839+ eq (get_cursor (), { 1 , 1 })
840+ end
841+
832842T [' Repeat jump with ;' ][' works with different mapping' ] = function ()
833843 child .api .nvim_del_keymap (' n' , ' ;' )
834844 reload_module ({ mappings = { repeat_jump = ' g;' } })
You can’t perform that action at this time.
0 commit comments