File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -289,14 +289,20 @@ impl Tile {
289289 Some ( Message :: ChangeFocus ( ArrowKey :: Down , 1 ) )
290290 }
291291 keyboard:: Key :: Character ( chr) => {
292- if modifiers. command ( ) && chr. to_string ( ) == "r" {
292+ let s = chr. to_string ( ) ;
293+ if modifiers. command ( ) && s == "r" {
293294 Some ( Message :: ReloadConfig )
294- } else if chr. to_string ( ) == "p" && modifiers. control ( ) {
295+ } else if modifiers. command ( ) {
296+ s. parse :: < usize > ( )
297+ . ok ( )
298+ . filter ( |& n| n >= 1 && n <= 9 )
299+ . map ( |n| Message :: OpenResult ( ( n - 1 ) as u32 ) )
300+ } else if s == "p" && modifiers. control ( ) {
295301 Some ( Message :: ChangeFocus ( ArrowKey :: Up , 1 ) )
296- } else if chr . to_string ( ) == "n" && modifiers. control ( ) {
302+ } else if s == "n" && modifiers. control ( ) {
297303 Some ( Message :: ChangeFocus ( ArrowKey :: Down , 1 ) )
298304 } else {
299- Some ( Message :: FocusTextInput ( Move :: Forwards ( chr . to_string ( ) ) ) )
305+ Some ( Message :: FocusTextInput ( Move :: Forwards ( s ) ) )
300306 }
301307 }
302308 keyboard:: Key :: Named ( Named :: Enter ) => Some ( Message :: OpenFocused ) ,
You can’t perform that action at this time.
0 commit comments