## Patch 6.0.159

Expand Messages
• Patch 6.0.159 Problem: Wildcard expansion for :emenu also shows separators. Solution: Skip menu separators for :emenu , :popup and :tearoff . Also,
Message 1 of 1 , Feb 1, 2002
Patch 6.0.159
Problem: Wildcard expansion for ":emenu" also shows separators.
Also, don't handle ":tmenu" as if it was ":tearoff". And leave
out the alternatives with "&" included.

*** ../vim60.158/src/menu.c Tue Jan 15 16:37:40 2002
--- src/menu.c Wed Jan 30 21:43:51 2002
***************
*** 1160,1165 ****
--- 1160,1166 ----
*/
static int expand_modes = 0x0;

/*
* Work out what to complete when doing command line completion of menu names.
***************
*** 1211,1218 ****
else if (*p == '.')
after_dot = p + 1;
}
! expand_menus = !(*cmd == 't' || *cmd == 'p');
return NULL; /* TODO: check for next command? */
if (*p == NUL) /* Complete the menu name */
{
--- 1212,1222 ----
else if (*p == '.')
after_dot = p + 1;
}
!
! /* ":tearoff" and ":popup" only use menus, not entries */
! expand_menus = !((*cmd == 't' && cmd[1] == 'e') || *cmd == 'p');
! expand_emenu = (*cmd == 'e');
return NULL; /* TODO: check for next command? */
if (*p == NUL) /* Complete the menu name */
{
***************
*** 1277,1283 ****
}

/*
! * Function given to ExpandGeneric() to obtain the list of group names.
*/
char_u *
--- 1281,1288 ----
}

/*
! * Function given to ExpandGeneric() to obtain the list of (sub)menus (not
! * entries).
*/
char_u *
***************
*** 1285,1338 ****
int idx;
{
- static int get_dname = FALSE; /* return menu->dname next time */
char_u *str;

if (idx == 0) /* first call: start at first item */
- {
- get_dname = FALSE;
- }

/* Skip PopUp[nvoci]. */

return NULL;

! {
! if (get_dname)
! {
! get_dname = FALSE;
! }
! else
! {
! get_dname = TRUE;
! }
! }
else
- {
str = (char_u *)"";
- get_dname = FALSE;
- }

! if (!get_dname)

return str;
}

/*
! * Function given to ExpandGeneric() to obtain the list of group names.
*/
char_u *
--- 1290,1324 ----
int idx;
{
char_u *str;

if (idx == 0) /* first call: start at first item */

/* Skip PopUp[nvoci]. */

return NULL;

else
str = (char_u *)"";

return str;
}

/*
! * Function given to ExpandGeneric() to obtain the list of menus and menu
! * entries.
*/
char_u *
***************
*** 1348,1357 ****

/* Skip Browse-style entries, popup menus and separators. */
#ifndef FEAT_BROWSE
#endif
--- 1334,1342 ----

/* Skip Browse-style entries, popup menus and separators. */
#ifndef FEAT_BROWSE
#endif
*** ../vim60.158/src/version.c Fri Feb 1 20:07:17 2002
--- src/version.c Fri Feb 1 20:01:23 2002
***************
*** 608,609 ****
--- 608,611 ----
{ /* Add new patch number below this line */
+ /**/
+ 159,
/**/

--
hundred-and-one symptoms of being an internet addict: