Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add comment about move_to_line_end
  • Loading branch information
samlich committed Apr 29, 2023
commit 883b4c8b5b29a8989830b16f832b265b79898d6c
3 changes: 2 additions & 1 deletion src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,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 @@ -1188,6 +1188,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