Skip to content

Commit

Permalink
chore(#621): Exit atuin when pressing down arrow on most recent entry (
Browse files Browse the repository at this point in the history
…#659)

Signed-off-by: Baptiste Roux <arte.but.posix@gmail.com>

Signed-off-by: Baptiste Roux <arte.but.posix@gmail.com>
  • Loading branch information
BapRx committed Jan 10, 2023
1 parent b01d9f8 commit 5821893
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/command/client/search/interactive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ impl State {
}
TermEvent::Key(Key::Down | Key::Ctrl('n' | 'j'))
| TermEvent::Mouse(MouseEvent::Press(MouseButton::WheelDown, _, _)) => {
if self.results_state.selected() == 0 && input.eq(&TermEvent::Key(Key::Down)) {
return Some(RETURN_ORIGINAL);
}
let i = self.results_state.selected().saturating_sub(1);
self.results_state.select(i);
}
Expand Down

0 comments on commit 5821893

Please sign in to comment.