File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -392,22 +392,23 @@ impl Application {
392
392
scroll : None ,
393
393
jobs : & mut self . jobs ,
394
394
} ;
395
- let parts = command. split_whitespace ( ) . collect :: < Vec < & str > > ( ) ;
395
+ let mut parts = command. split_whitespace ( ) . collect :: < Vec < & str > > ( ) ;
396
396
if parts. is_empty ( ) {
397
397
return ;
398
398
}
399
399
400
400
let event = crate :: ui:: PromptEvent :: Validate ;
401
401
// Handle numeric commands
402
- let cmd = if parts. len ( ) == 1 && parts[ 0 ] . parse :: < usize > ( ) . ok ( ) . is_some ( ) {
403
- "goto"
402
+ let command = if parts. len ( ) == 1 && parts[ 0 ] . parse :: < usize > ( ) . ok ( ) . is_some ( ) {
403
+ parts. insert ( 0 , "goto" ) ;
404
+ format ! ( "goto {}" , parts[ 1 ] )
404
405
} else {
405
- parts [ 0 ]
406
+ command . to_string ( )
406
407
} ;
407
408
408
409
// Handle typable commands
409
- if let Some ( cmd) = typed:: TYPABLE_COMMAND_MAP . get ( cmd ) {
410
- let shellwords = Shellwords :: from ( command) ;
410
+ if let Some ( cmd) = typed:: TYPABLE_COMMAND_MAP . get ( parts [ 0 ] ) {
411
+ let shellwords = Shellwords :: from ( command. as_str ( ) ) ;
411
412
let args = shellwords. words ( ) ;
412
413
413
414
if let Err ( e) = ( cmd. fun ) ( & mut cx, & args[ 1 ..] , event) {
You can’t perform that action at this time.
0 commit comments