helix icon indicating copy to clipboard operation
helix copied to clipboard

Make "repeat last insert" respect the number prefix

Open xJonathanLEI opened this issue 2 years ago • 3 comments

With the current implementation, when you press <n>., the last insert is repeated only once, completely ignoring the number <n>, unlike in vim where it's indeed inserted <n> times.

This feature is useful for inserting repeated characters. I currently work around this issue by recording the insert as a macro, and do <n>q instead, but this isn't very efficient.

I would like to implement this feature, but would love to get a green light from the core team first just in case the current behavior is actually intended. Thanks!

xJonathanLEI avatar Oct 19 '22 04:10 xJonathanLEI

I'd say you can go ahead and open a PR for this; the current behaviour definitely isn't explicitly intended.

Omnikar avatar Oct 19 '22 07:10 Omnikar

I've prepared quick fix for this issue. Took liberty to do that despite original author willing to do it, but I really wanted to have it fixed asap.

I don't quite get why this operation is so special that is handled differently than other commands. I probably need more context on that particular operation.

My main question here would be - is it possible to define this operation as normal operation (maybe like macro), and not as special case?

kosciej avatar Oct 24 '22 17:10 kosciej

There's a separate issue for that: https://github.com/helix-editor/helix/issues/1488

the-mikedavis avatar Oct 24 '22 22:10 the-mikedavis