aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fold.c
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-04-15 13:21:38 -0400
committerJames McCoy <jamessan@jamessan.com>2017-04-19 22:24:58 -0400
commitc5d7eaf66468d5f71049a602e820c19d8ad8c772 (patch)
tree0e33af591a5d1abb709d6421371c47d6d13ee7e2 /src/nvim/fold.c
parentf0c12012d99b33474bd6bb5dcb0ee3a6c6808789 (diff)
downloadrneovim-c5d7eaf66468d5f71049a602e820c19d8ad8c772.tar.gz
rneovim-c5d7eaf66468d5f71049a602e820c19d8ad8c772.tar.bz2
rneovim-c5d7eaf66468d5f71049a602e820c19d8ad8c772.zip
vim-patch:7.4.2152
Problem: No proper translation of messages with a count. Solution: Use ngettext(). (Sergey Alyoshin) https://github.com/vim/vim/commit/ee695f787ade7fd88fc5f5497553d95c0c3645b5
Diffstat (limited to 'src/nvim/fold.c')
-rw-r--r--src/nvim/fold.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/nvim/fold.c b/src/nvim/fold.c
index 34db4d2171..ff3f46cb78 100644
--- a/src/nvim/fold.c
+++ b/src/nvim/fold.c
@@ -1689,12 +1689,10 @@ static void foldDelMarker(linenr_T lnum, char_u *marker, size_t 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.
- */
+// 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[FOLD_TEXT_LEN]".
+/// Otherwise the result is in allocated memory.
char_u *get_foldtext(win_T *wp, linenr_T lnum, linenr_T lnume,
foldinfo_T *foldinfo, char_u *buf)
FUNC_ATTR_NONNULL_ARG(1)
@@ -1781,8 +1779,12 @@ char_u *get_foldtext(win_T *wp, linenr_T lnum, linenr_T lnume,
}
}
if (text == NULL) {
- sprintf((char *)buf, _("+--%3ld lines folded "),
- (long)(lnume - lnum + 1));
+ unsigned long count = (unsigned long)(lnume - lnum + 1);
+
+ vim_snprintf((char *)buf, FOLD_TEXT_LEN,
+ ngettext("+--%3ld line folded",
+ "+--%3ld lines folded ", count),
+ count);
text = buf;
}
return text;