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:
mgpinf authored and Wez Furlong committed 2025-03-17 06:29:59 -07:00
1 parent 12b971ac44
commit 7053748e4d
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -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 {
+2 -2
View File
@@ -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 {