summaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2023-05-23 18:00:58 +0100
committerBram Moolenaar <Bram@vim.org>2023-05-23 18:00:58 +0100
commita8490a4952c320f234ae4528d4a1e812a27f3a0a (patch)
tree93460fc0c676f2c6c801b724dfea551ff5eac0e5 /src/buffer.c
parent167fb6d39b23e0967dabc523ce190e7447114e69 (diff)
patch 9.0.1575: "file N of M" message is not translatedv9.0.1575
Problem: "file N of M" message is not translated. Solution: Make argument count message translatable. (close #12429)
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/buffer.c b/src/buffer.c
index ff7c50fae1..a47342a3f5 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5278,24 +5278,21 @@ append_arg_number(
int buflen,
int add_file) // Add "file" before the arg number
{
- char_u *p;
-
if (ARGCOUNT <= 1) // nothing to do
return FALSE;
- p = buf + STRLEN(buf); // go to the end of the buffer
- if (p - buf + 35 >= buflen) // getting too long
- return FALSE;
- *p++ = ' ';
- *p++ = '(';
- if (add_file)
+ char *msg;
+ switch ((wp->w_arg_idx_invalid ? 1 : 0) + (add_file ? 2 : 0))
{
- STRCPY(p, "file ");
- p += 5;
+ case 0: msg = _(" (%d of %d)"); break;
+ case 1: msg = _(" ((%d) of %d)"); break;
+ case 2: msg = _(" (file %d of %d)"); break;
+ case 3: msg = _(" (file (%d) of %d)"); break;
}
- vim_snprintf((char *)p, (size_t)(buflen - (p - buf)),
- wp->w_arg_idx_invalid ? "(%d) of %d)"
- : "%d of %d)", wp->w_arg_idx + 1, ARGCOUNT);
+
+ char_u *p = buf + STRLEN(buf); // go to the end of the buffer
+ vim_snprintf((char *)p, (size_t)(buflen - (p - buf)), msg,
+ wp->w_arg_idx + 1, ARGCOUNT);
return TRUE;
}