Skip to content

fix(engine): keep history traversal alive while moving inside a recalled entry - #1171

Open
kronberger-droid wants to merge 2 commits into
nushell:mainfrom
kronberger-droid:fix/history-walk-multiline
Open

fix(engine): keep history traversal alive while moving inside a recalled entry#1171
kronberger-droid wants to merge 2 commits into
nushell:mainfrom
kronberger-droid:fix/history-walk-multiline

Conversation

@kronberger-droid

Copy link
Copy Markdown
Collaborator

Summary

up_command/down_command move inside a recalled multi-line entry before they reach for history.
Since #1109 they do so through run_edit_commands, which also ends InputMode::HistoryTraversal.
The next Up/Down at the buffer edge thus started a fresh HistoryCursor from 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_commands still ends traversal on any edit.
Restores the pre-#1109 behaviour, all edit modes.
No public API change.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant