aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-12-17 08:11:35 +0800
committerGitHub <noreply@github.com>2022-12-17 08:11:35 +0800
commit4d860a537076d7eddfb29372ecbdacf1eb5b7d3b (patch)
tree37616ef667c9bb2459de422956952b89c5f1bfdb /src
parent37915cc5abd5c6f6ae89c1091304c8da2b0fa8fe (diff)
downloadrneovim-4d860a537076d7eddfb29372ecbdacf1eb5b7d3b.tar.gz
rneovim-4d860a537076d7eddfb29372ecbdacf1eb5b7d3b.tar.bz2
rneovim-4d860a537076d7eddfb29372ecbdacf1eb5b7d3b.zip
fix(folds): use long for number of folded lines (#21447)
Also remove some duplicate unsigned long casts.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/buffer.c8
-rw-r--r--src/nvim/ex_docmd.c4
-rw-r--r--src/nvim/fold.c4
3 files changed, 8 insertions, 8 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index b67aee6907..0c74ccf0f4 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -1090,13 +1090,13 @@ char *do_bufdel(int command, char *arg, int addr_count, int start_bnr, int end_b
errormsg = (char *)IObuff;
} else if (deleted >= p_report) {
if (command == DOBUF_UNLOAD) {
- smsg(NGETTEXT("%d buffer unloaded", "%d buffers unloaded", (unsigned long)deleted),
+ smsg(NGETTEXT("%d buffer unloaded", "%d buffers unloaded", deleted),
deleted);
} else if (command == DOBUF_DEL) {
- smsg(NGETTEXT("%d buffer deleted", "%d buffers deleted", (unsigned long)deleted),
+ smsg(NGETTEXT("%d buffer deleted", "%d buffers deleted", deleted),
deleted);
} else {
- smsg(NGETTEXT("%d buffer wiped out", "%d buffers wiped out", (unsigned long)deleted),
+ smsg(NGETTEXT("%d buffer wiped out", "%d buffers wiped out", deleted),
deleted);
}
}
@@ -3149,7 +3149,7 @@ void fileinfo(int fullname, int shorthelp, int dont_truncate)
vim_snprintf_add(buffer, IOSIZE,
NGETTEXT("%" PRId64 " line --%d%%--",
"%" PRId64 " lines --%d%%--",
- (unsigned long)curbuf->b_ml.ml_line_count),
+ curbuf->b_ml.ml_line_count),
(int64_t)curbuf->b_ml.ml_line_count, n);
} else {
vim_snprintf_add(buffer, IOSIZE,
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 88ae0a8226..3a28d557e3 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -4391,14 +4391,14 @@ static int check_more(int message, bool forceit)
vim_snprintf((char *)buff, DIALOG_MSG_SIZE,
NGETTEXT("%d more file to edit. Quit anyway?",
- "%d more files to edit. Quit anyway?", (unsigned long)n), n);
+ "%d more files to edit. Quit anyway?", n), n);
if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 1) == VIM_YES) {
return OK;
}
return FAIL;
}
semsg(NGETTEXT("E173: %" PRId64 " more file to edit",
- "E173: %" PRId64 " more files to edit", (unsigned long)n), (int64_t)n);
+ "E173: %" PRId64 " more files to edit", n), (int64_t)n);
quitmore = 2; // next try to quit is allowed
}
return FAIL;
diff --git a/src/nvim/fold.c b/src/nvim/fold.c
index 08b963ae89..275ddc6912 100644
--- a/src/nvim/fold.c
+++ b/src/nvim/fold.c
@@ -1781,7 +1781,7 @@ char *get_foldtext(win_T *wp, linenr_T lnum, linenr_T lnume, foldinfo_T foldinfo
}
}
if (text == NULL) {
- unsigned long count = (unsigned long)(lnume - lnum + 1); // NOLINT(bugprone-misplaced-widening-cast)
+ long count = lnume - lnum + 1;
vim_snprintf(buf, FOLD_TEXT_LEN,
NGETTEXT("+--%3ld line folded",
@@ -3269,7 +3269,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);
size_t len = strlen(txt)
+ strlen(dashes) // for %s