refactor: remove redundant character checks in Launcher, InputSelector
We don't need to check if the alphabet includes 'j', 'k' because if a character is included in the alphabet, the code corresponding to the first arm is executed
This commit is contained in:
1 parent
12b971ac44
commit
7053748e4d
2 files changed
+4
-4
No files matched your search
@@ -506,13 +506,13 @@ impl LauncherState {
|
||||
InputEvent::Key(KeyEvent {
|
||||
key: KeyCode::Char('j'),
|
||||
..
|
||||
}) if !self.filtering && !self.alphabet.contains("j") => {
|
||||
}) if !self.filtering => {
|
||||
self.move_down();
|
||||
}
|
||||
InputEvent::Key(KeyEvent {
|
||||
key: KeyCode::Char('k'),
|
||||
..
|
||||
}) if !self.filtering && !self.alphabet.contains("k") => {
|
||||
}) if !self.filtering => {
|
||||
self.move_up();
|
||||
}
|
||||
InputEvent::Key(KeyEvent {
|
||||
|
||||
@@ -260,13 +260,13 @@ impl SelectorState {
|
||||
InputEvent::Key(KeyEvent {
|
||||
key: KeyCode::Char('j'),
|
||||
..
|
||||
}) if !self.filtering && !self.args.alphabet.contains("j") => {
|
||||
}) if !self.filtering => {
|
||||
self.move_down();
|
||||
}
|
||||
InputEvent::Key(KeyEvent {
|
||||
key: KeyCode::Char('k'),
|
||||
..
|
||||
}) if !self.filtering && !self.args.alphabet.contains("k") => {
|
||||
}) if !self.filtering => {
|
||||
self.move_up();
|
||||
}
|
||||
InputEvent::Key(KeyEvent {
|
||||
|
||||
Reference in new issue
Block a user