Skip to content

Commit

Permalink
add comment about move_to_line_end
Browse files Browse the repository at this point in the history
  • Loading branch information
samlich committed Apr 12, 2023
1 parent 0a46a2e commit 7d5d692
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ impl Reedline {
{
Some(Ok(())) => {
self.update_buffer_from_history();
// TODO: are these needed/correct?
// Move to end of first line, see `Self::previous_history()`.
self.editor.move_to_start(UndoBehavior::HistoryNavigation);
self.editor
.move_to_line_end(UndoBehavior::HistoryNavigation);
Expand Down Expand Up @@ -1092,6 +1092,7 @@ impl Reedline {
.back(self.history.as_ref())
.expect("todo: error handling");
self.update_buffer_from_history();
// Move to end of *first* line, so that pressing up again goes directly to previous item.
self.editor.move_to_start(UndoBehavior::HistoryNavigation);
self.editor
.move_to_line_end(UndoBehavior::HistoryNavigation);
Expand Down

0 comments on commit 7d5d692

Please sign in to comment.