vim --clean20new set laststatus=2 statusline=%P call setline(1, range(1, 40)) exe "normal! \<C-E>"
The statusline should show " 5%", according to documentation:
P S Percentage through file of displayed window. This is like the
percentage described for 'ruler'. Always 3 in length, unless
translated.
9.1.1888
Operating system: Arch Linux
Terminal: kitty 0.43.1
Value of $TERM: xterm-kitty
Shell: fish 4.1.2
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Perhaps it's better to just revert to the formatting before patch 9.1.1291:
diff --git a/src/buffer.c b/src/buffer.c index 548df8051..ca2a2495d 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -5427,10 +5427,9 @@ get_rel_pos( "%s", _("Top")); int perc = calc_percentage(above, above + below); - char tmp[8]; // localized percentage value - vim_snprintf(tmp, sizeof(tmp), _("%d%%"), perc); - return (int)vim_snprintf_safelen((char *)buf, buflen, _("%2s"), tmp); + return (int)vim_snprintf_safelen((char *)buf, buflen, _("%s%d%%"), + (perc < 10) ? " " : "", perc); } /*
But then the translation files may also need to be reverted?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
zeertzjq left a comment (vim/vim#18669)
Perhaps it's better to just revert to the formatting before patch 9.1.1291
return (int)vim_snprintf_safelen((char *)buf, buflen, _("%2s"), tmp);
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Yeah, I'd think the following should be fine (except for the required translation updates)?
diff --git a/src/buffer.c b/src/buffer.c index 548df8051..44d7bdd09 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -5430,7 +5430,7 @@ get_rel_pos( char tmp[8]; // localized percentage value vim_snprintf(tmp, sizeof(tmp), _("%d%%"), perc); - return (int)vim_snprintf_safelen((char *)buf, buflen, _("%2s"), tmp); + return (int)vim_snprintf_safelen((char *)buf, buflen, _("%3.3s"), tmp); } /*
This should always be 3 characters wide percentage value, no?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
%3.3s doesn't look right. If %d%% has a multibyte translation but %3.3s, it may even truncate the percentage in the middle of the multibyte character.
However %3s does seem to work and doesn't require a translation update.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
A numeric percentage?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
A numeric percentage?
I'm not sure what you are referring to.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
Nevermind. Thanks for the pr
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
Closed #18669 as completed via 73a0de4.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()