@@ -11,7 +11,7 @@ import { TagMatcher } from './../common/matching/tagMatcher';
1111import { VimState } from './../state/vimState' ;
1212import { configuration } from './../configuration/configuration' ;
1313import { shouldWrapKey } from './wrapping' ;
14- import { VimError , ErrorCode } from '../error' ;
14+ import { VimError } from '../error' ;
1515import { BaseMovement , SelectionType , IMovement , isIMovement , failedMovement } from './baseMotion' ;
1616import { globalState } from '../state/globalState' ;
1717import { reportSearch } from '../util/statusBarTextUtils' ;
@@ -468,10 +468,7 @@ class CommandNextSearchMatch extends BaseMovement {
468468 globalState . hl = true ;
469469
470470 if ( searchState . getMatchRanges ( vimState ) . length === 0 ) {
471- StatusBar . displayError (
472- vimState ,
473- VimError . fromCode ( ErrorCode . PatternNotFound , searchState . searchString ) ,
474- ) ;
471+ StatusBar . displayError ( vimState , VimError . PatternNotFound ( searchState . searchString ) ) ;
475472 return failedMovement ( vimState ) ;
476473 }
477474
@@ -488,12 +485,9 @@ class CommandNextSearchMatch extends BaseMovement {
488485 if ( ! nextMatch ) {
489486 StatusBar . displayError (
490487 vimState ,
491- VimError . fromCode (
492- searchState . direction === SearchDirection . Forward
493- ? ErrorCode . SearchHitBottom
494- : ErrorCode . SearchHitTop ,
495- searchState . searchString ,
496- ) ,
488+ searchState . direction === SearchDirection . Forward
489+ ? VimError . SearchHitBottom ( searchState . searchString )
490+ : VimError . SearchHitTop ( searchState . searchString ) ,
497491 ) ;
498492 return failedMovement ( vimState ) ;
499493 }
@@ -523,10 +517,7 @@ class CommandPreviousSearchMatch extends BaseMovement {
523517 globalState . hl = true ;
524518
525519 if ( searchState . getMatchRanges ( vimState ) . length === 0 ) {
526- StatusBar . displayError (
527- vimState ,
528- VimError . fromCode ( ErrorCode . PatternNotFound , searchState . searchString ) ,
529- ) ;
520+ StatusBar . displayError ( vimState , VimError . PatternNotFound ( searchState . searchString ) ) ;
530521 return failedMovement ( vimState ) ;
531522 }
532523
@@ -546,12 +537,9 @@ class CommandPreviousSearchMatch extends BaseMovement {
546537 if ( ! prevMatch ) {
547538 StatusBar . displayError (
548539 vimState ,
549- VimError . fromCode (
550- searchState . direction === SearchDirection . Forward
551- ? ErrorCode . SearchHitTop
552- : ErrorCode . SearchHitBottom ,
553- searchState . searchString ,
554- ) ,
540+ searchState . direction === SearchDirection . Forward
541+ ? VimError . SearchHitTop ( searchState . searchString )
542+ : VimError . SearchHitBottom ( searchState . searchString ) ,
555543 ) ;
556544 return failedMovement ( vimState ) ;
557545 }
@@ -576,15 +564,15 @@ export abstract class BaseMarkMovement extends BaseMovement {
576564 const mark = vimState . historyTracker . getMark ( markName ) ;
577565
578566 if ( mark === undefined ) {
579- throw VimError . fromCode ( ErrorCode . MarkNotSet ) ;
567+ throw VimError . MarkNotSet ( ) ;
580568 }
581569
582570 if (
583571 mark . isUppercaseMark &&
584572 vimState . recordedState . operator &&
585573 mark . document !== vimState . document
586574 ) {
587- throw VimError . fromCode ( ErrorCode . MarkNotSet ) ;
575+ throw VimError . MarkNotSet ( ) ;
588576 }
589577
590578 if ( this . registerMode ) {
0 commit comments