Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Undo undoes multiple actions, most notably repeat history (".") #358

Open
arthaud opened this issue Jan 23, 2025 · 0 comments
Open

Undo undoes multiple actions, most notably repeat history (".") #358

arthaud opened this issue Jan 23, 2025 · 0 comments

Comments

@arthaud
Copy link

arthaud commented Jan 23, 2025

Hello,

First of all, thanks for making this, this is a lifesaver! The fact that all keyboard actions are simple dance commands made it easy to recreate my weird helix configuration.

I have a bug with "undo" (u) when using repeat history ("."). It undoes more than a single action.

For instance, assume we start with a file containing:

A
B
C

Then, place your cursor on A, go into insert mode, add X and a space, then go back to normal mode:

X A
B
C

Go to the second line, on B, and press the repeat-history (usually mapped to dot ".")

X A
X B
C

Do the same on the next line. Go to C and press repeat-history

X A
X B
X C

Now, if you press undo (u), this will remove the X on C, but also on B. It "undoes" the two previous actions.
Current result:

XA
B
C

Expected: (only undo the last action)

X A
X B
C

(it's even slightly worse, as it also removes the space between X and A. not sure why)

I would love to have this fixed, as it is quite annoying. I use repeat-history quite often.
If I get the time, I might look into this, so I would appreciate pointers if no one else wants to fix it. Is there a way to force the repeat-history to "record" an action? Or does this need a whole rework of the history logic handling?

Thanks.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant