Skip to content

fix: let no-op cursor moves fall through - #1208

Merged
kronberger-droid merged 1 commit into
nushell:mainfrom
okuuva:push-lvopwtlqrxup
Sep 11, 2026
Merged

kronberger-droid merged 1 commit into
nushell:mainfrom
okuuva:push-lvopwtlqrxup

Conversation

@okuuva

@okuuva okuuva commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Make cursor movement commands report whether they changed the cursor or selection, allowing UntilFound to continue to a fallback event after a blocked move. This enables navigating multiline prompts while still allowing atuin to trigger command-history search when pressing Up on the topmost line.

This changes observable UntilFound behavior 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 UntilFound before its fallback event could run.

After

Cursor movement commands compare the complete cursor state before and after execution. They report Inapplicable when neither the position nor selection changes, allowing UntilFound to try its next event. Movements that change the cursor or collapse a selection still report Applied.

No-op moves preserve redo and history traversal. The Left and Right events propagate edit status so their fallbacks can run too. Eligible quick-menu dismissal remains handled even when the cursor stays put, without consuming other inapplicable moves.

Tests cover vertical, horizontal, and line-edge movements at boundaries, plus a missing-target selection motion. Regression coverage also checks the Left/Right aliases, redo, history traversal, and menu dismissal.

Additional notes

Addresses the cursor-movement portion of #876.

Related Atuin issue: atuinsh/atuin#798.

Comment thread src/core_editor/editor.rs Outdated
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.

Preserve redo and history traversal after no-op moves. Propagate edit
status through Left and Right events so their fallbacks can run too.
Keep eligible quick-menu dismissal handled even when the cursor stays
put, without consuming other inapplicable moves.

Cover vertical, horizontal, and line-edge movements at boundaries, plus
a missing-target selection motion. Add regression coverage for the
Left/Right aliases, redo, history traversal, and menu dismissal.

Addresses the cursor-movement portion of nushell#876.
See also: atuinsh/atuin#798
@kronberger-droid
kronberger-droid merged commit 436f17b into nushell:main Sep 11, 2026
7 checks passed
okuuva added a commit to okuuva/atuin that referenced this pull request Sep 14, 2026
On Nushell 0.115.2 and newer, try `movelineup` after `menuup` and before
opening Atuin. Keep the existing chain on older versions, where blocked
cursor movement prevents fallback.

Requires the [no-op cursor movement fallback fix in Reedline][1].
Nushell picked it up in [nushell/nushell#19013][2].

Related: atuinsh#798

[1]: nushell/reedline#1208
[2]: nushell/nushell#19013
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.

2 participants