From eca9421e87f19bd4e8af5f834a5d961c7ed9b841 Mon Sep 17 00:00:00 2001 From: Chris Glass Date: Fri, 10 Apr 2026 18:36:16 +0200 Subject: [PATCH] We don't need to match for only one case Instead, let's use a simple if statement. If in the future we need to care about other cases, we can introduce a match statement again. --- src/main.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2347c32..3e815a1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -748,16 +748,16 @@ impl App { if self.find { widget::text_input::focus(self.find_search_id.clone()) } else if self.core.window.show_context { - match self.context_page { - ContextPage::KeyboardShortcuts => { - if self.shortcut_search_focus.get() { - self.shortcut_search_focus.set(false); - return widget::text_input::focus(self.shortcut_search_id.clone()); - } - } - // TODO focus for other context pages? - _ => {} + // Right now we only care about the KeyboardShortcuts context page, so we use a simple if. + // In the future if we are to care about other conext pages, we could switch this to a match + // statement instead to be cleaner. + if self.context_page == ContextPage::KeyboardShortcuts + && self.shortcut_search_focus.get() + { + self.shortcut_search_focus.set(false); + return widget::text_input::focus(self.shortcut_search_id.clone()); } + Task::none() } else if let Some(terminal_id) = self.terminal_ids.get(&self.pane_model.focused()).cloned() {