Collapsed if statements (#534)

This commit is contained in:
Adam Perkowski 2024-09-19 20:29:08 +02:00 committed by GitHub
parent 3497b63071
commit d0ff354c49
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -125,17 +125,15 @@ pub fn draw_shortcuts(state: &AppState, frame: &mut Frame, area: Rect) {
if state.at_root() {
hints.push(Shortcut::new(vec!["h", "Left"], "Focus tab list"));
hints.extend(get_list_item_shortcut(state));
} else if state.selected_item_is_up_dir() {
hints.push(Shortcut::new(
vec!["l", "Right", "Enter", "h", "Left"],
"Go to parent directory",
));
} else {
if state.selected_item_is_up_dir() {
hints.push(Shortcut::new(
vec!["l", "Right", "Enter", "h", "Left"],
"Go to parent directory",
));
} else {
hints.push(Shortcut::new(vec!["h", "Left"], "Go to parent directory"));
hints.extend(get_list_item_shortcut(state));
}
};
hints.push(Shortcut::new(vec!["h", "Left"], "Go to parent directory"));
hints.extend(get_list_item_shortcut(state));
}
hints.push(Shortcut::new(vec!["k", "Up"], "Select item above"));
hints.push(Shortcut::new(vec!["j", "Down"], "Select item below"));
hints.push(Shortcut::new(vec!["t"], "Next theme"));