Skip to content

fix(vi): stop dot-repeat recording itself#1102

Merged
kronberger-droid merged 2 commits into
nushell:mainfrom
kronberger-droid:vi-dot-repeat
Jun 15, 2026
Merged

fix(vi): stop dot-repeat recording itself#1102
kronberger-droid merged 2 commits into
nushell:mainfrom
kronberger-droid:vi-dot-repeat

Conversation

@kronberger-droid

Copy link
Copy Markdown
Collaborator

. should replay the last change, but it was recording its own replay back into previous.
Each press re-wrapped previous in another Multiple, so the nesting grew by one per . (and 2. doubled the inner vec).
Observationally fine, since the engine flattens on replay, but previous grew without bound over a session.

Fix: skip recording when the command is RepeatLastAction.
. is not itself a change, so it must not update the repeat register.

The recording policy was duplicated across two arms of to_reedline_event, so this also folds it into a single record_previous helper.

The existing repeated_dot_accumulates_nesting_in_previous test pinned the buggy behavior, which got renamed and flipped to assert depth stays flat across repeated ..

@kronberger-droid kronberger-droid merged commit 27d9989 into nushell:main Jun 15, 2026
7 checks passed
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