diff options
author | James McCoy <jamessan@jamessan.com> | 2017-04-19 23:15:45 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-19 23:15:45 -0400 |
commit | 462c53eb3ea256bb85eb3916400d984347f0626f (patch) | |
tree | e196f6fa8b9c03009f383349c86b5ca79acf7199 /src/nvim/fold.c | |
parent | f0c12012d99b33474bd6bb5dcb0ee3a6c6808789 (diff) | |
parent | cb02137dfac7357650a2e9cc32acb66326e59058 (diff) | |
download | rneovim-462c53eb3ea256bb85eb3916400d984347f0626f.tar.gz rneovim-462c53eb3ea256bb85eb3916400d984347f0626f.tar.bz2 rneovim-462c53eb3ea256bb85eb3916400d984347f0626f.zip |
Merge pull request #6547 from jamessan/vim-7.4.2152
vim-patch:7.4.2152,7.4.2165,7.4.2173,7.4.2179,7.4.2209
Diffstat (limited to 'src/nvim/fold.c')
-rw-r--r-- | src/nvim/fold.c | 18 |
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; |