summaryrefslogtreecommitdiff
path: root/src/list.rs
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-08-24 00:23:45 +0200
committermo8it <mo8it@proton.me>2024-08-24 00:23:45 +0200
commit4e12725616abe1918d6a4f21b23288dfac237cc4 (patch)
tree638eabc75f99c3496b671955ee4518ec5e3e988e /src/list.rs
parent570bc9f32d7ef0bf741fab44d15f7cd54a1f3fc1 (diff)
Don't exit the list on "to current" if nothing is selected
Diffstat (limited to 'src/list.rs')
-rw-r--r--src/list.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/list.rs b/src/list.rs
index 754c5e2..27a31d1 100644
--- a/src/list.rs
+++ b/src/list.rs
@@ -63,7 +63,9 @@ fn handle_list(app_state: &mut AppState, stdout: &mut StdoutLock) -> Result<()>
list_state.reset_selected()?;
}
KeyCode::Char('c') => {
- return list_state.selected_to_current_exercise();
+ if list_state.selected_to_current_exercise()? {
+ return Ok(());
+ }
}
// Redraw to remove the message.
KeyCode::Esc => (),