summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <bram@vim.org>2011-07-20 17:27:25 +0200
committerBram Moolenaar <bram@vim.org>2011-07-20 17:27:25 +0200
commit265405fd5bc64b1ef298ea1df52efb4ab91a8e90 (patch)
treeb91ef482eefbadf1ba27e1920d17656e515bc7ef
parente291725ae35d043a0c6d1c281a86185d0665ce31 (diff)
downloadvim-265405fd5bc64b1ef298ea1df52efb4ab91a8e90.tar.gz
updated for version 7.3.258v7.3.258v7-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)
-rw-r--r--src/GvimExt/gvimext.cpp19
-rw-r--r--src/version.c2
2 files changed, 19 insertions, 2 deletions
diff --git a/src/GvimExt/gvimext.cpp b/src/GvimExt/gvimext.cpp
index 55d5a763..7c7ec99d 100644
--- a/src/GvimExt/gvimext.cpp
+++ b/src/GvimExt/gvimext.cpp
@@ -586,8 +586,23 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu,
// 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
index 6c1cfdcc..f007bc58 100644
--- 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,