fix: let no-op cursor moves fall through - #1208
Open
okuuva wants to merge 1 commit into
Open
Conversation
|
|
||
| self.update_undo_state(new_undo_behavior); | ||
| status | ||
| if matches!(command.edit_type(), EditType::MoveCursor { .. }) |
Collaborator
There was a problem hiding this comment.
This regresses menu handling.
ReedlineEvent::Edit returns early on Inapplicable at engine.rs:1709, before the quick-completion bookkeeping below it, and MoveToLineStart { select: false } is in that block's deactivate list.
So with quick_completions on and a menu open, Ctrl+A with the cursor already at the line start no longer closes the menu, where on main it does.
Either exempt the deactivate-list commands from the early return, or run the bookkeeping before it.
Cursor movement commands always reported Applied, even when they left the cursor and selection unchanged. That stopped UntilFound before a fallback event could run. Compare the complete cursor state before and after every MoveCursor command. Report Inapplicable only when neither position nor selection changes, so blocked moves fall through while selection collapse remains Applied. Cover vertical, horizontal, and line-edge movements at boundaries, plus a missing-target selection motion. Addresses the cursor-movement portion of nushell#876. See also: atuinsh/atuin#798
okuuva
force-pushed
the
push-lvopwtlqrxup
branch
from
September 10, 2026 12:15
7a4740e to
6a05c58
Compare
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
Make cursor movement commands report whether they changed the cursor or selection, allowing
UntilFoundto continue to a fallback event after a blocked move.Enables e.g. navigating multiline prompts while still allowing
atuinto trigger search for command line history when hittingUpon the topmost line.This changes observable
UntilFoundbehavior but does not change Reedline's public API.Before
Cursor movement commands always reported
Applied, even when they left the cursor and selection unchanged.A blocked movement therefore stopped
UntilFoundbefore its fallback event could run.After
Cursor movement commands compare the complete cursor state before and after execution.
They report
Inapplicablewhen neither the position nor selection changes, allowingUntilFoundto try its next event.Movements that change the cursor or collapse a selection still report
Applied.Tests cover vertical, horizontal, and line-edge movements, plus a missing-target selection motion.
Additional notes
Addresses the cursor-movement portion of #876.
Related Atuin issue: atuinsh/atuin#798