diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-05-20 21:25:31 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-05-20 21:25:31 +0000 |
commit | 35c54e56513137e58a649983fbab6c490820462e (patch) | |
tree | be889f5f102662931bb883f401173a07d8778432 /src/screen.c | |
parent | c1087e64bcfece96de8fa812535154435bbaaba5 (diff) | |
download | vim-git-35c54e56513137e58a649983fbab6c490820462e.tar.gz |
updated for version 7.0074
Diffstat (limited to 'src/screen.c')
-rw-r--r-- | src/screen.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/src/screen.c b/src/screen.c index 58fb4d029..013978875 100644 --- a/src/screen.c +++ b/src/screen.c @@ -4818,6 +4818,7 @@ draw_vsep_win(wp, row) #ifdef FEAT_WILDMENU static int status_match_len __ARGS((expand_T *xp, char_u *s)); +static int skip_status_match_char __ARGS((expand_T *xp, char_u *s)); /* * Get the lenght of an item as it will be shown in the status line. @@ -4840,12 +4841,7 @@ status_match_len(xp, s) while (*s != NUL) { - /* Don't display backslashes used for escaping, they look ugly. */ - if (rem_backslash(s) -#ifdef FEAT_MENU - || (emenu && (s[0] == '\\' && s[1] != NUL)) -#endif - ) + if (skip_status_match_char(xp, s)) ++s; len += ptr2cells(s); mb_ptr_adv(s); @@ -4855,6 +4851,24 @@ status_match_len(xp, s) } /* + * Return TRUE for characters that are not displayed in a status match. + * These are backslashes used for escaping. Do show backslashes in help tags. + */ + static int +skip_status_match_char(xp, s) + expand_T *xp; + char_u *s; +{ + return ((rem_backslash(s) && xp->xp_context != EXPAND_HELP) +#ifdef FEAT_MENU + || ((xp->xp_context == EXPAND_MENUS + || xp->xp_context == EXPAND_MENUNAMES) + && (s[0] == '\t' || (s[0] == '\\' && s[1] != NUL))) +#endif + ); +} + +/* * Show wildchar matches in the status line. * Show at least the "match" item. * We start at item 'first_match' in the list and show all matches that fit. @@ -4989,13 +5003,7 @@ win_redr_status_matches(xp, num_matches, matches, match, showtail) #endif for ( ; *s != NUL; ++s) { - /* Don't display backslashes used for escaping, they look ugly. */ - if (rem_backslash(s) -#ifdef FEAT_MENU - || (emenu - && (s[0] == '\t' || (s[0] == '\\' && s[1] != NUL))) -#endif - ) + if (skip_status_match_char(xp, s)) ++s; clen += ptr2cells(s); #ifdef FEAT_MBYTE |