# HG changeset patch # User Bram Moolenaar # Date 1311175645 -7200 # Node ID bdc3335bd72eea207b28fcf8af90a73c855c8847 # Parent f3b689420c866107f31ba7b3bd13e5e655fc2c3b 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) diff --git a/src/GvimExt/gvimext.cpp b/src/GvimExt/gvimext.cpp --- a/src/GvimExt/gvimext.cpp +++ b/src/GvimExt/gvimext.cpp @@ -586,8 +586,23 @@ STDMETHODIMP CShellExt::QueryContextMenu // Initialize m_cntOfHWnd to 0 m_cntOfHWnd = 0; - // Retrieve all the vim instances - EnumWindows(EnumWindowsProc, (LPARAM)this); + + HKEY keyhandle; + bool showExisting = true; + + // Check whether "Edit with existing Vim" entries are disabled. + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Vim\\Gvim", 0, + KEY_READ, &keyhandle) == ERROR_SUCCESS) + { + if (RegQueryValueEx(keyhandle, "DisableEditWithExisting", 0, NULL, + NULL, NULL) == ERROR_SUCCESS) + showExisting = false; + RegCloseKey(keyhandle); + } + + // Retrieve all the vim instances, unless disabled. + if (showExisting) + EnumWindows(EnumWindowsProc, (LPARAM)this); if (cbFiles > 1) { diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -710,6 +710,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 258, +/**/ 257, /**/ 256,