File tree 2 files changed +30
-23
lines changed
2 files changed +30
-23
lines changed Original file line number Diff line number Diff line change @@ -675,12 +675,15 @@ char separately.
675
675
(when _state.phase (set _state.phase 2 ))
676
676
677
677
; Jump eagerly to the count-th match (without giving the full pattern)?
678
- (when (contains ? spec - keys.next_target ?in2 )
678
+ (local partial- pattern ? (contains ? spec - keys.next_target ?in2 ))
679
+ ; Do this now - repeat can succeed, even if we fail this time.
680
+ (update - repeat - state in1 (when-not partial- pattern ? ?in2 ))
681
+
682
+ (when partial- pattern ?
679
683
(local n (or count 1 ))
680
684
(local target (. targets n ))
681
685
(when-not target
682
686
(exit - early ))
683
- (update - repeat - state in1 nil )
684
687
; Do this before `do-action`, because it might erase forced motion.
685
688
; (The `:normal` command in `jump.jump-to!` can change the state of
686
689
; `mode()`. See vim/vim#9332.)
@@ -692,9 +695,6 @@ char separately.
692
695
693
696
(exec - user - autocmds :LeapPatternPost)
694
697
695
- ; Do this now - repeat can succeed, even if we fail this time.
696
- (update - repeat - state in1 ?in2 )
697
-
698
698
; Get the sublist for ?in2, and work with that from here on (except if
699
699
; we've been given custom targets).
700
700
(local targets * (if targets.sublists (. targets.sublists ?in2 ) targets ))
You can’t perform that action at this time.
0 commit comments