diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-08-03 22:08:45 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-08-03 22:08:45 +0200 |
commit | ee695f787ade7fd88fc5f5497553d95c0c3645b5 (patch) | |
tree | 222deac7781773672758c4466687c7367f014ef3 /src/fold.c | |
parent | cf25fdb8f10a92b3bf9e295c466c1b69812b7886 (diff) | |
download | vim-git-ee695f787ade7fd88fc5f5497553d95c0c3645b5.tar.gz |
patch 7.4.2152v7.4.2152
Problem: No proper translation of messages with a count.
Solution: Use ngettext(). (Sergey Alyoshin)
Diffstat (limited to 'src/fold.c')
-rw-r--r-- | src/fold.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/fold.c b/src/fold.c index 35ceceb4a..1eaad192b 100644 --- a/src/fold.c +++ b/src/fold.c @@ -1853,8 +1853,8 @@ foldDelMarker(linenr_T lnum, char_u *marker, int markerlen) /* get_foldtext() {{{2 */ /* * Return the text for a closed fold at line "lnum", with last line "lnume". - * When 'foldtext' isn't set puts the result in "buf[51]". Otherwise the - * result is in allocated memory. + * When 'foldtext' isn't set puts the result in "buf[FOLD_TEXT_LEN]". + * Otherwise the result is in allocated memory. */ char_u * get_foldtext( @@ -1960,8 +1960,12 @@ get_foldtext( if (text == NULL) #endif { - sprintf((char *)buf, _("+--%3ld lines folded "), - (long)(lnume - lnum + 1)); + long count = (long)(lnume - lnum + 1); + + vim_snprintf((char *)buf, FOLD_TEXT_LEN, + ngettext("+--%3ld line folded ", + "+--%3ld lines folded ", count), + count); text = buf; } return text; |