From 4e12725616abe1918d6a4f21b23288dfac237cc4 Mon Sep 17 00:00:00 2001 From: mo8it Date: Sat, 24 Aug 2024 00:23:45 +0200 Subject: Don't exit the list on "to current" if nothing is selected --- src/list.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/list.rs') 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 => (), -- cgit v1.2.3