aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/buffer.c2
-rw-r--r--src/nvim/screen.c20
-rw-r--r--src/nvim/version.c2
3 files changed, 13 insertions, 11 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 04a3235dc6..8909fdd57a 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -3443,7 +3443,7 @@ int build_stl_str_hl(
case STL_KEYMAP:
fillable = false;
- if (get_keymap_str(wp, tmp, TMPLEN))
+ if (get_keymap_str(wp, (char_u *)"<%s>", tmp, TMPLEN))
str = tmp;
break;
case STL_PAGENUM:
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index 41acc48f97..c0db076eff 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -4912,7 +4912,7 @@ void win_redr_status(win_T *wp)
screen_fill(row, row + 1, len + wp->w_wincol,
this_ru_col + wp->w_wincol, fillchar, fillchar, attr);
- if (get_keymap_str(wp, NameBuff, MAXPATHL)
+ if (get_keymap_str(wp, (char_u *)"<%s>", NameBuff, MAXPATHL)
&& this_ru_col - len > (int)(STRLEN(NameBuff) + 1))
screen_puts(NameBuff, row, (int)(this_ru_col - STRLEN(NameBuff)
- 1 + wp->w_wincol), attr);
@@ -4993,8 +4993,9 @@ int stl_connected(win_T *wp)
int
get_keymap_str (
win_T *wp,
- char_u *buf, /* buffer for the result */
- int len /* length of buffer */
+ char_u *fmt, // format string containing one %s item
+ char_u *buf, // buffer for the result
+ int len // length of buffer
)
{
char_u *p;
@@ -5021,10 +5022,9 @@ get_keymap_str (
else
p = (char_u *)"lang";
}
- if ((int)(STRLEN(p) + 3) < len)
- sprintf((char *)buf, "<%s>", p);
- else
+ if (vim_snprintf((char *)buf, len, (char *)fmt, p) > len - 1) {
buf[0] = NUL;
+ }
xfree(s);
}
return buf[0] != NUL;
@@ -6752,10 +6752,12 @@ int showmode(void)
if (p_fkmap)
MSG_PUTS_ATTR(farsi_text_5, attr);
if (State & LANGMAP) {
- if (curwin->w_p_arab)
+ if (curwin->w_p_arab) {
MSG_PUTS_ATTR(_(" Arabic"), attr);
- else
- MSG_PUTS_ATTR(_(" (lang)"), attr);
+ } else if (get_keymap_str(curwin, (char_u *)" (%s)",
+ NameBuff, MAXPATHL)) {
+ MSG_PUTS_ATTR(NameBuff, attr);
+ }
}
if ((State & INSERT) && p_paste)
MSG_PUTS_ATTR(_(" (paste)"), attr);
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 76dfe67204..04b42ed39f 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -341,7 +341,7 @@ static int included_patches[] = {
// 2102 NA
// 2101,
2100,
- // 2099,
+ 2099,
// 2098,
// 2097,
// 2096,