mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.1.0492: "Edit with existing Vim" list can get long
Problem: "Edit with existing Vim" list can get long. Solution: Move the list to a submenu. (Ken Takata, closes #3561)
This commit is contained in:
@@ -708,11 +708,26 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu,
|
|||||||
m_edit_existing_off = 1;
|
m_edit_existing_off = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HMENU hSubMenu = NULL;
|
||||||
|
if (m_cntOfHWnd > 1)
|
||||||
|
{
|
||||||
|
hSubMenu = CreatePopupMenu();
|
||||||
|
mii.fMask |= MIIM_SUBMENU;
|
||||||
|
mii.wID = idCmd;
|
||||||
|
mii.dwTypeData = _("Edit with existing Vim");
|
||||||
|
mii.cch = lstrlen(mii.dwTypeData);
|
||||||
|
mii.hSubMenu = hSubMenu;
|
||||||
|
InsertMenuItem(hMenu, indexMenu++, TRUE, &mii);
|
||||||
|
mii.fMask = mii.fMask & ~MIIM_SUBMENU;
|
||||||
|
mii.hSubMenu = NULL;
|
||||||
|
}
|
||||||
// Now display all the vim instances
|
// Now display all the vim instances
|
||||||
for (int i = 0; i < m_cntOfHWnd; i++)
|
for (int i = 0; i < m_cntOfHWnd; i++)
|
||||||
{
|
{
|
||||||
char title[BUFSIZE];
|
char title[BUFSIZE];
|
||||||
char temp[BUFSIZE];
|
char temp[BUFSIZE];
|
||||||
|
int index;
|
||||||
|
HMENU hmenu;
|
||||||
|
|
||||||
// Obtain window title, continue if can not
|
// Obtain window title, continue if can not
|
||||||
if (GetWindowText(m_hWnd[i], title, BUFSIZE - 1) == 0)
|
if (GetWindowText(m_hWnd[i], title, BUFSIZE - 1) == 0)
|
||||||
@@ -726,15 +741,30 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu,
|
|||||||
*pos = 0;
|
*pos = 0;
|
||||||
}
|
}
|
||||||
// Now concatenate
|
// Now concatenate
|
||||||
|
if (m_cntOfHWnd > 1)
|
||||||
|
temp[0] = '\0';
|
||||||
|
else
|
||||||
|
{
|
||||||
strncpy(temp, _("Edit with existing Vim - "), BUFSIZE - 1);
|
strncpy(temp, _("Edit with existing Vim - "), BUFSIZE - 1);
|
||||||
temp[BUFSIZE - 1] = '\0';
|
temp[BUFSIZE - 1] = '\0';
|
||||||
|
}
|
||||||
strncat(temp, title, BUFSIZE - 1 - strlen(temp));
|
strncat(temp, title, BUFSIZE - 1 - strlen(temp));
|
||||||
temp[BUFSIZE - 1] = '\0';
|
temp[BUFSIZE - 1] = '\0';
|
||||||
|
|
||||||
mii.wID = idCmd++;
|
mii.wID = idCmd++;
|
||||||
mii.dwTypeData = temp;
|
mii.dwTypeData = temp;
|
||||||
mii.cch = lstrlen(mii.dwTypeData);
|
mii.cch = lstrlen(mii.dwTypeData);
|
||||||
InsertMenuItem(hMenu, indexMenu++, TRUE, &mii);
|
if (m_cntOfHWnd > 1)
|
||||||
|
{
|
||||||
|
hmenu = hSubMenu;
|
||||||
|
index = i;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hmenu = hMenu;
|
||||||
|
index = indexMenu++;
|
||||||
|
}
|
||||||
|
InsertMenuItem(hmenu, index, TRUE, &mii);
|
||||||
}
|
}
|
||||||
// InsertMenu(hMenu, indexMenu++, MF_SEPARATOR|MF_BYPOSITION, 0, NULL);
|
// InsertMenu(hMenu, indexMenu++, MF_SEPARATOR|MF_BYPOSITION, 0, NULL);
|
||||||
|
|
||||||
|
@@ -792,6 +792,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
492,
|
||||||
/**/
|
/**/
|
||||||
491,
|
491,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user