Skip to content

Commit 883b4c8

Browse files
committed
add comment about move_to_line_end
1 parent e6e84c8 commit 883b4c8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/engine.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,7 @@ impl Reedline {
11171117
{
11181118
Some(Ok(())) => {
11191119
self.update_buffer_from_history();
1120-
// TODO: are these needed/correct?
1120+
// Move to end of first line, see `Self::previous_history()`.
11211121
self.editor.move_to_start(UndoBehavior::HistoryNavigation);
11221122
self.editor
11231123
.move_to_line_end(UndoBehavior::HistoryNavigation);
@@ -1188,6 +1188,7 @@ impl Reedline {
11881188
.back(self.history.as_ref())
11891189
.expect("todo: error handling");
11901190
self.update_buffer_from_history();
1191+
// Move to end of *first* line, so that pressing up again goes directly to previous item.
11911192
self.editor.move_to_start(UndoBehavior::HistoryNavigation);
11921193
self.editor
11931194
.move_to_line_end(UndoBehavior::HistoryNavigation);

0 commit comments

Comments
 (0)