Merge pull request #21449 from neovim/zeertzjq-patch-1

[Backport release-0.8] fix(folds): use long for number of folded lines
This commit is contained in:
zeertzjq 2022-12-17 08:38:21 +08:00 committed by GitHub
commit bc6ff78fad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1772,7 +1772,7 @@ char *get_foldtext(win_T *wp, linenr_T lnum, linenr_T lnume, foldinfo_T foldinfo
} }
} }
if (text == NULL) { if (text == NULL) {
unsigned long count = (unsigned long)(lnume - lnum + 1); long count = lnume - lnum + 1;
vim_snprintf(buf, FOLD_TEXT_LEN, vim_snprintf(buf, FOLD_TEXT_LEN,
NGETTEXT("+--%3ld line folded", NGETTEXT("+--%3ld line folded",
@ -3260,7 +3260,7 @@ void f_foldtext(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
} }
} }
} }
int count = foldend - foldstart + 1; long count = foldend - foldstart + 1;
char *txt = NGETTEXT("+-%s%3ld line: ", "+-%s%3ld lines: ", count); char *txt = NGETTEXT("+-%s%3ld line: ", "+-%s%3ld lines: ", count);
size_t len = strlen(txt) size_t len = strlen(txt)
+ strlen(dashes) // for %s + strlen(dashes) // for %s