fix(engine): keep history traversal alive while moving inside a recalled entry - #1171
Open
kronberger-droid wants to merge 2 commits into
Open
fix(engine): keep history traversal alive while moving inside a recalled entry#1171kronberger-droid wants to merge 2 commits into
kronberger-droid wants to merge 2 commits into
Conversation
Up recalls a two-line entry, Down moves to its second line, and the next Down should continue to the newer entry (the empty draft). The Up mirror walks back to the older entry from the first line. Both fail today: the in-entry line move ends history traversal, so the edge press starts a fresh cursor from the recalled text and finds nothing past it.
…led entry `up_command`/`down_command` move between the lines of a multi-line entry before they reach for history, and since nushell#1109 they do so through `run_edit_commands` so the cursor settles under the mode's rest policy. That call also flips `InputMode::HistoryTraversal` back to `Regular`, so the next press at the buffer edge built a fresh `HistoryCursor` from the recalled text and found nothing past it: Up, Down, Down was stuck on the two-line entry instead of returning to the draft. Split the body into `apply_edit_commands`, which runs the commands under the rest policy without touching the input mode, and use that for the two in-entry line moves. `run_edit_commands` keeps its public contract of ending traversal on any edit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
up_command/down_commandmove inside a recalled multi-line entry before they reach for history.Since #1109 they do so through
run_edit_commands, which also endsInputMode::HistoryTraversal.The next Up/Down at the buffer edge thus started a fresh
HistoryCursorfrom the recalled text, found nothing past it and wrote the prefix back: the walk was stuck on the entry.Split the body into
apply_edit_commands, which runs the commands under the rest policy without touching the input mode, and use that for the two in-entry line moves.run_edit_commandsstill ends traversal on any edit.Restores the pre-#1109 behaviour, all edit modes.
No public API change.