File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -687,11 +687,16 @@ export const exCommandParser: Parser<{ lineRange: LineRange | undefined; command
687
687
) ;
688
688
}
689
689
const result = seq ( parseArgs , optWhitespace . then ( all ) ) . parse ( args ) ;
690
- if ( result . status === false || result . value [ 1 ] ) {
691
- // TODO: All possible parsing errors are lumped into "trailing characters", which is wrong
690
+ if ( result . status === false ) {
691
+ if ( result . index . offset === args . length ) {
692
+ throw VimError . fromCode ( ErrorCode . ArgumentRequired ) ;
693
+ }
694
+ throw VimError . fromCode ( ErrorCode . InvalidArgument474 ) ;
695
+ }
696
+ if ( result . value [ 1 ] ) {
692
697
// TODO: Implement `:help :bar`
693
698
// TODO: Implement `:help :comment`
694
- throw VimError . fromCode ( ErrorCode . TrailingCharacters ) ;
699
+ throw VimError . fromCode ( ErrorCode . TrailingCharacters , result . value [ 1 ] ) ;
695
700
}
696
701
return { lineRange, command : result . value [ 0 ] } ;
697
702
} ) ;
Original file line number Diff line number Diff line change @@ -426,7 +426,7 @@ suite('Vimscript expressions', () => {
426
426
exprTest ( "'abc' ==? 'Abc'" , { value : bool ( true ) } ) ;
427
427
} ) ;
428
428
429
- suite . only ( 'Pattern matching' , ( ) => {
429
+ suite ( 'Pattern matching' , ( ) => {
430
430
exprTest ( "'apple' =~ '^a.*e$'" , { value : bool ( true ) } ) ;
431
431
// TODO
432
432
} ) ;
@@ -532,7 +532,7 @@ suite('Vimscript expressions', () => {
532
532
} ) ;
533
533
534
534
suite ( 'Builtin functions' , ( ) => {
535
- suite . only ( 'assert_*' , ( ) => {
535
+ suite ( 'assert_*' , ( ) => {
536
536
const PASS = { value : int ( 0 ) } ;
537
537
const FAIL = { value : int ( 1 ) } ;
538
538
You can’t perform that action at this time.
0 commit comments