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.
This commit is contained in:
parent
72a27129e3
commit
eca9421e87
1 changed files with 9 additions and 9 deletions
18
src/main.rs
18
src/main.rs
|
|
@ -748,16 +748,16 @@ impl App {
|
||||||
if self.find {
|
if self.find {
|
||||||
widget::text_input::focus(self.find_search_id.clone())
|
widget::text_input::focus(self.find_search_id.clone())
|
||||||
} else if self.core.window.show_context {
|
} else if self.core.window.show_context {
|
||||||
match self.context_page {
|
// Right now we only care about the KeyboardShortcuts context page, so we use a simple if.
|
||||||
ContextPage::KeyboardShortcuts => {
|
// In the future if we are to care about other conext pages, we could switch this to a match
|
||||||
if self.shortcut_search_focus.get() {
|
// statement instead to be cleaner.
|
||||||
self.shortcut_search_focus.set(false);
|
if self.context_page == ContextPage::KeyboardShortcuts
|
||||||
return widget::text_input::focus(self.shortcut_search_id.clone());
|
&& self.shortcut_search_focus.get()
|
||||||
}
|
{
|
||||||
}
|
self.shortcut_search_focus.set(false);
|
||||||
// TODO focus for other context pages?
|
return widget::text_input::focus(self.shortcut_search_id.clone());
|
||||||
_ => {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Task::none()
|
Task::none()
|
||||||
} else if let Some(terminal_id) = self.terminal_ids.get(&self.pane_model.focused()).cloned()
|
} else if let Some(terminal_id) = self.terminal_ids.get(&self.pane_model.focused()).cloned()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue