mirror of
https://github.com/vim/vim.git
synced 2025-10-24 08:54:47 -04:00
patch 9.1.1479: regression when displaying localized percentage position
Problem: regression when displaying localized percentage position
(after v9.1.1291)
Solution: calculate percentage first (Emir SARI)
Cleanups made in ec032de broke the Turkish percent display, failing to
prepend it properly in cases between 0 and 10. In Turkish, the percent
sign is prepended to the number, so it was displaying it as `% 5`
(should have been `%5`), while displaying numbers bigger than 9 properly.
related: #17597
Signed-off-by: Emir SARI <emir_sari@icloud.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
468c62e4fd
commit
8fe9e55a7d
@@ -5411,9 +5411,11 @@ get_rel_pos(
|
||||
return (int)vim_snprintf_safelen((char *)buf, buflen,
|
||||
"%s", _("Top"));
|
||||
|
||||
int perc = calc_percentage(above, above + below);
|
||||
char tmp[8];
|
||||
// localized percentage value
|
||||
return (int)vim_snprintf_safelen((char *)buf, buflen,
|
||||
_("%2d%%"), calc_percentage(above, above + below));
|
||||
vim_snprintf(tmp, sizeof(tmp), _("%d%%"), perc);
|
||||
return (int)vim_snprintf_safelen((char *)buf, buflen, _("%2s"), tmp);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user