To: vim_dev@googlegroups.com Subject: Patch 7.4.2099 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.2099 Problem: When a keymap is active only "(lang)" is displayed. (Ilya Dogolazky) Solution: Show the keymap name. (Dmitri Vereshchagin, closes #933) Files: src/buffer.c, src/proto/screen.pro, src/screen.c *** ../vim-7.4.2098/src/buffer.c 2016-07-14 23:03:15.116509331 +0200 --- src/buffer.c 2016-07-24 16:10:23.434267344 +0200 *************** *** 4114,4120 **** case STL_KEYMAP: fillable = FALSE; ! if (get_keymap_str(wp, tmp, TMPLEN)) str = tmp; break; case STL_PAGENUM: --- 4114,4120 ---- case STL_KEYMAP: fillable = FALSE; ! if (get_keymap_str(wp, (char_u *)"<%s>", tmp, TMPLEN)) str = tmp; break; case STL_PAGENUM: *** ../vim-7.4.2098/src/proto/screen.pro 2016-04-02 19:39:11.781258089 +0200 --- src/proto/screen.pro 2016-07-24 16:10:23.434267344 +0200 *************** *** 23,29 **** void win_redr_status_matches(expand_T *xp, int num_matches, char_u **matches, int match, int showtail); void win_redr_status(win_T *wp); int stl_connected(win_T *wp); ! int get_keymap_str(win_T *wp, char_u *buf, int len); void screen_putchar(int c, int row, int col, int attr); void screen_getbytes(int row, int col, char_u *bytes, int *attrp); void screen_puts(char_u *text, int row, int col, int attr); --- 23,29 ---- void win_redr_status_matches(expand_T *xp, int num_matches, char_u **matches, int match, int showtail); void win_redr_status(win_T *wp); int stl_connected(win_T *wp); ! int get_keymap_str(win_T *wp, char_u *fmt, char_u *buf, int len); void screen_putchar(int c, int row, int col, int attr); void screen_getbytes(int row, int col, char_u *bytes, int *attrp); void screen_puts(char_u *text, int row, int col, int attr); *** ../vim-7.4.2098/src/screen.c 2016-07-10 23:16:05.112753072 +0200 --- src/screen.c 2016-07-24 16:11:36.965532716 +0200 *************** *** 6767,6773 **** screen_fill(row, row + 1, len + W_WINCOL(wp), this_ru_col + W_WINCOL(wp), fillchar, fillchar, attr); ! if (get_keymap_str(wp, NameBuff, MAXPATHL) && (int)(this_ru_col - len) > (int)(STRLEN(NameBuff) + 1)) screen_puts(NameBuff, row, (int)(this_ru_col - STRLEN(NameBuff) - 1 + W_WINCOL(wp)), attr); --- 6767,6773 ---- screen_fill(row, row + 1, len + W_WINCOL(wp), this_ru_col + W_WINCOL(wp), fillchar, fillchar, attr); ! if (get_keymap_str(wp, (char_u *)"<%s>", NameBuff, MAXPATHL) && (int)(this_ru_col - len) > (int)(STRLEN(NameBuff) + 1)) screen_puts(NameBuff, row, (int)(this_ru_col - STRLEN(NameBuff) - 1 + W_WINCOL(wp)), attr); *************** *** 6862,6867 **** --- 6862,6868 ---- int get_keymap_str( win_T *wp, + char_u *fmt, /* format string containing one %s item */ char_u *buf, /* buffer for the result */ int len) /* length of buffer */ { *************** *** 6894,6902 **** #endif p = (char_u *)"lang"; } ! if ((int)(STRLEN(p) + 3) < len) ! sprintf((char *)buf, "<%s>", p); ! else buf[0] = NUL; #ifdef FEAT_EVAL vim_free(s); --- 6895,6901 ---- #endif p = (char_u *)"lang"; } ! if (vim_snprintf((char *)buf, len, (char *)fmt, p) > len - 1) buf[0] = NUL; #ifdef FEAT_EVAL vim_free(s); *************** *** 10166,10172 **** MSG_PUTS_ATTR(_(" Arabic"), attr); else # endif ! MSG_PUTS_ATTR(_(" (lang)"), attr); } #endif if ((State & INSERT) && p_paste) --- 10165,10173 ---- MSG_PUTS_ATTR(_(" Arabic"), attr); else # endif ! if (get_keymap_str(curwin, (char_u *)" (%s)", ! NameBuff, MAXPATHL)) ! MSG_PUTS_ATTR(NameBuff, attr); } #endif if ((State & INSERT) && p_paste) *** ../vim-7.4.2098/src/version.c 2016-07-23 22:04:30.004702632 +0200 --- src/version.c 2016-07-24 16:14:32.315783654 +0200 *************** *** 760,761 **** --- 760,763 ---- { /* Add new patch number below this line */ + /**/ + 2099, /**/ -- Q: How do you tell the difference between a female cat and a male cat? A: You ask it a question and if HE answers, it's a male but, if SHE answers, it's a female. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///