Skip to content

Commit d0ff354

Browse files
Collapsed if statements (#534)
1 parent 3497b63 commit d0ff354

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

tui/src/hint.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,15 @@ pub fn draw_shortcuts(state: &AppState, frame: &mut Frame, area: Rect) {
125125
if state.at_root() {
126126
hints.push(Shortcut::new(vec!["h", "Left"], "Focus tab list"));
127127
hints.extend(get_list_item_shortcut(state));
128+
} else if state.selected_item_is_up_dir() {
129+
hints.push(Shortcut::new(
130+
vec!["l", "Right", "Enter", "h", "Left"],
131+
"Go to parent directory",
132+
));
128133
} else {
129-
if state.selected_item_is_up_dir() {
130-
hints.push(Shortcut::new(
131-
vec!["l", "Right", "Enter", "h", "Left"],
132-
"Go to parent directory",
133-
));
134-
} else {
135-
hints.push(Shortcut::new(vec!["h", "Left"], "Go to parent directory"));
136-
hints.extend(get_list_item_shortcut(state));
137-
}
138-
};
134+
hints.push(Shortcut::new(vec!["h", "Left"], "Go to parent directory"));
135+
hints.extend(get_list_item_shortcut(state));
136+
}
139137
hints.push(Shortcut::new(vec!["k", "Up"], "Select item above"));
140138
hints.push(Shortcut::new(vec!["j", "Down"], "Select item below"));
141139
hints.push(Shortcut::new(vec!["t"], "Next theme"));

0 commit comments

Comments
 (0)