Don't exit the list on "to current" if nothing is selected

This commit is contained in:
mo8it
2024-08-24 00:23:45 +02:00
parent 570bc9f32d
commit 4e12725616
2 changed files with 14 additions and 10 deletions
+3 -1
View File
@@ -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 => (),