Skip to content

Commit ce35c88

Browse files
committed
updated for version 7.3.258
Problem: MS-Windows: The edit with existing vim context menu entries can be unwanted. Solution: Let a registry entry disable them. (Jerome Vuarand)
1 parent e9edd7f commit ce35c88

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

src/GvimExt/gvimext.cpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,23 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu,
586586

587587
// Initialize m_cntOfHWnd to 0
588588
m_cntOfHWnd = 0;
589-
// Retrieve all the vim instances
590-
EnumWindows(EnumWindowsProc, (LPARAM)this);
589+
590+
HKEY keyhandle;
591+
bool showExisting = true;
592+
593+
// Check whether "Edit with existing Vim" entries are disabled.
594+
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Vim\\Gvim", 0,
595+
KEY_READ, &keyhandle) == ERROR_SUCCESS)
596+
{
597+
if (RegQueryValueEx(keyhandle, "DisableEditWithExisting", 0, NULL,
598+
NULL, NULL) == ERROR_SUCCESS)
599+
showExisting = false;
600+
RegCloseKey(keyhandle);
601+
}
602+
603+
// Retrieve all the vim instances, unless disabled.
604+
if (showExisting)
605+
EnumWindows(EnumWindowsProc, (LPARAM)this);
591606

592607
if (cbFiles > 1)
593608
{

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,8 @@ static char *(features[]) =
709709

710710
static int included_patches[] =
711711
{ /* Add new patch number below this line */
712+
/**/
713+
258,
712714
/**/
713715
257,
714716
/**/

0 commit comments

Comments
 (0)