diff options
author | Bram Moolenaar <Bram@vim.org> | 2011-07-20 17:27:25 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2011-07-20 17:27:25 +0200 |
commit | ce35c88adedd855fe9b0a93c9f1d38388fd928f0 (patch) | |
tree | d52ba6a527c6c001358a6d63c7c3167701c3f559 /src/GvimExt | |
parent | e9edd7fbdd1d815f6135e269dbc94bd0824cf33f (diff) | |
download | vim-git-ce35c88adedd855fe9b0a93c9f1d38388fd928f0.tar.gz |
updated for version 7.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)
Diffstat (limited to 'src/GvimExt')
-rw-r--r-- | src/GvimExt/gvimext.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/GvimExt/gvimext.cpp b/src/GvimExt/gvimext.cpp index 55d5a7633..7c7ec99d3 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) { |