if you use a repetition count above 999999999, it silently changes your repetition count to 999999999.
for example, if you are in normal mode in a buffer with just a 0, and type 1234567890^A, you get 999999999 instead of 1234567890, despite showcmd still showing 1234567890:
./vim -u <(echo set showcmd) -<<<01234567890^Abefore ^A:
after ^A:
it looks like this is caused because showcmd and count deal with big things differently.
for showcmd, it just shows the 10 most recent characters:
https://github.com/vim/vim/blob/master/src/normal.c#L1772-L1777
and count just caps at 999999999L (9 nines):
https://github.com/vim/vim/blob/master/src/normal.c#L246
since these limits are so close to each other, I think it would make sense to change the count cap to 9999999999L (10 nines), and then set both cap->count0 and showcmd_buf to exactly 9999999999 if the count cap is exceeded. or if the max is from power of two reasons you could set both to 2147483647 or 4294967295. this would properly tell the user that their count has magically changed.
VIM - Vi IMproved 9.2 (2026 Feb 14, compiled Jul 6 2026) Included patches: 1-782
n/a
n/a
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
this diff appears to fix the error, but idk what all styles you want. kinda just moved some random declarations earlier so that I could use that one function:
diff --git a/src/normal.c b/src/normal.c index b803b88f6..e1ec5ddd0 100644 --- a/src/normal.c +++ b/src/normal.c @@ -214,6 +214,16 @@ check_text_or_curbuf_locked(oparg_T *oap) return TRUE; } +/* + * Routines for displaying a partly typed command + */ + +static char_u old_showcmd_buf[SHOWCMD_BUFLEN]; // For push_showcmd() +static int showcmd_is_clear = TRUE; +static int showcmd_visual = FALSE; + +static void display_showcmd(void); + /* * Handle the count before a normal command and set cap->count0. */ @@ -241,9 +251,11 @@ getcount: cap->count0 /= 10; del_from_showcmd(4); // delete the digit and ~@% } - else if (cap->count0 > 99999999L) + else if (cap->count0 > 999999999L) { - cap->count0 = 999999999L; + cap->count0 = 9999999999L; + mch_memmove(showcmd_buf, "9999999999", 10); + display_showcmd(); } else { @@ -1600,15 +1612,6 @@ may_clear_cmdline(void) clear_showcmd(); } -/* - * Routines for displaying a partly typed command - */ - -static char_u old_showcmd_buf[SHOWCMD_BUFLEN]; // For push_showcmd() -static int showcmd_is_clear = TRUE; -static int showcmd_visual = FALSE; - -static void display_showcmd(void); - void clear_showcmd(void)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()