@@ -436,7 +436,7 @@ class CommandNextSearchMatch extends BaseMovement {
436
436
keys = [ 'n' ] ;
437
437
isJump = true ;
438
438
439
- public async execAction ( position : Position , vimState : VimState ) : Promise < Position > {
439
+ public async execAction ( position : Position , vimState : VimState ) : Promise < Position | IMovement > {
440
440
const searchState = globalState . searchState ;
441
441
442
442
if ( ! searchState || searchState . searchString === '' ) {
@@ -451,7 +451,7 @@ class CommandNextSearchMatch extends BaseMovement {
451
451
vimState ,
452
452
VimError . fromCode ( ErrorCode . PatternNotFound , searchState . searchString )
453
453
) ;
454
- return position ;
454
+ return failedMovement ( vimState ) ;
455
455
}
456
456
457
457
// we have to handle a special case here: searching for $ or \n,
@@ -474,7 +474,7 @@ class CommandNextSearchMatch extends BaseMovement {
474
474
searchState . searchString
475
475
)
476
476
) ;
477
- return position ;
477
+ return failedMovement ( vimState ) ;
478
478
}
479
479
480
480
reportSearch ( nextMatch . index , searchState . getMatchRanges ( vimState . editor ) . length , vimState ) ;
@@ -488,7 +488,7 @@ class CommandPreviousSearchMatch extends BaseMovement {
488
488
keys = [ 'N' ] ;
489
489
isJump = true ;
490
490
491
- public async execAction ( position : Position , vimState : VimState ) : Promise < Position > {
491
+ public async execAction ( position : Position , vimState : VimState ) : Promise < Position | IMovement > {
492
492
const searchState = globalState . searchState ;
493
493
494
494
if ( ! searchState || searchState . searchString === '' ) {
@@ -503,7 +503,7 @@ class CommandPreviousSearchMatch extends BaseMovement {
503
503
vimState ,
504
504
VimError . fromCode ( ErrorCode . PatternNotFound , searchState . searchString )
505
505
) ;
506
- return position ;
506
+ return failedMovement ( vimState ) ;
507
507
}
508
508
509
509
const searchForward = searchState . searchDirection === SearchDirection . Forward ;
@@ -533,7 +533,7 @@ class CommandPreviousSearchMatch extends BaseMovement {
533
533
searchState . searchString
534
534
)
535
535
) ;
536
- return position ;
536
+ return failedMovement ( vimState ) ;
537
537
}
538
538
539
539
reportSearch ( prevMatch . index , searchState . getMatchRanges ( vimState . editor ) . length , vimState ) ;
0 commit comments