Skip to content

Commit b06c843

Browse files
authored
Merge pull request rust-lang#2384 from senekor/senekor/kvvswrqlorup
Allow selecting next exercise with enter key
2 parents b730882 + b86a532 commit b06c843

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ fn handle_list(app_state: &mut AppState, stdout: &mut StdoutLock) -> Result<()>
8383
}
8484
}
8585
KeyCode::Char('r') => list_state.reset_selected()?,
86-
KeyCode::Char('c') => {
86+
KeyCode::Char('c') | KeyCode::Enter => {
8787
if list_state.selected_to_current_exercise()? {
8888
return Ok(());
8989
}

src/list/state.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ impl<'a> ListState<'a> {
237237
if self.message.is_empty() {
238238
// Help footer message
239239
if self.scroll_state.selected().is_some() {
240-
writer.write_str("↓/j ↑/k home/g end/G | <c>ontinue at | <r>eset exercise")?;
240+
writer
241+
.write_str("↓/j ↑/k home/g end/G | ↩️/<c>ontinue at | <r>eset exercise")?;
241242
next_ln(stdout)?;
242243
writer = MaxLenWriter::new(stdout, self.term_width as usize);
243244

0 commit comments

Comments
 (0)