]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.258 v7.3.258
authorBram Moolenaar <Bram@vim.org>
Wed, 20 Jul 2011 15:27:25 +0000 (17:27 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 20 Jul 2011 15:27:25 +0000 (17:27 +0200)
Problem:    MS-Windows: The edit with existing vim context menu entries can be
            unwanted.
Solution:   Let a registry entry disable them. (Jerome Vuarand)

src/GvimExt/gvimext.cpp
src/version.c

index 55d5a76338271301532f654a0d9e36e3ada47d9a..7c7ec99d3f04593e9ea904e041438b583a5b950e 100644 (file)
@@ -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)
     {
index 6c1cfdcc5ab36b4b284e5a46823d24c60a6b5dc1..f007bc580b90a1a731f7fd2406dc7a4d6ee4683c 100644 (file)
@@ -709,6 +709,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    258,
 /**/
     257,
 /**/