vim-patch:9.1.1890: %P in 'statusline' doesn't behave as documented

Problem:  %P in 'statusline' doesn't behave as documented
          (after 9.1.1479).
Solution: Make the percentage 3-chars wide when not translated.
          (zeertzjq)

fixes: vim/vim#18669
closes: vim/vim#18671

73a0de4a04

Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
This commit is contained in:
zeertzjq
2025-10-31 17:16:09 +08:00
parent a0f3fdba58
commit d4106bade7
2 changed files with 11 additions and 4 deletions

View File

@@ -3482,7 +3482,7 @@ int get_rel_pos(win_T *wp, char *buf, int buflen)
char tmp[8];
// localized percentage value
vim_snprintf(tmp, sizeof(tmp), _("%d%%"), perc);
return (int)vim_snprintf_safelen(buf, (size_t)buflen, _("%2s"), tmp);
return (int)vim_snprintf_safelen(buf, (size_t)buflen, _("%3s"), tmp);
}
/// Append (2 of 8) to "buf[]", if editing more than one file.