diff options
| author | Shougo <Shougo.Matsu@gmail.com> | 2017-01-16 06:24:12 +0900 |
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2017-01-15 22:24:12 +0100 |
| commit | 3fd7be6d3ed1b27b3c6f811d3f210cb9c30deaa4 (patch) | |
| tree | 026aab623c181da700a4b538add8422e8a9e63e4 /src/nvim/screen.c | |
| parent | b5560a69b12be5342358bc5528912ab887b678c8 (diff) | |
| download | rneovim-3fd7be6d3ed1b27b3c6f811d3f210cb9c30deaa4.tar.gz rneovim-3fd7be6d3ed1b27b3c6f811d3f210cb9c30deaa4.tar.bz2 rneovim-3fd7be6d3ed1b27b3c6f811d3f210cb9c30deaa4.zip | |
vim-patch:7.4.2099 (#5951)
Problem: When a keymap is active only "(lang)" is displayed. (Ilya
Dogolazky)
Solution: Show the keymap name. (Dmitri Vereshchagin, closes vim/vim#933)
https://github.com/vim/vim/commit/73ac0c4281a3606651604a3cbcc334bfb3859a87
Diffstat (limited to 'src/nvim/screen.c')
| -rw-r--r-- | src/nvim/screen.c | 20 |
1 files changed, 11 insertions, 9 deletions
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); |
