Patch 8.2.3870
Problem: MS-Windows: wrong working directory when opening two files with
right-click context menu. (Gabriel Dupras)
Solution: Use the working directory and pass it on to the process creation.
(Nir Lichtman, closes #9382, closes #8874)
Files: src/GvimExt/gvimext.cpp, src/GvimExt/gvimext.h
*** ../vim-8.2.3869/src/GvimExt/gvimext.cpp 2021-07-29 18:18:29.587186625
+0100
--- src/GvimExt/gvimext.cpp 2021-12-22 15:12:38.130789764 +0000
***************
*** 776,783 ****
// development.
return E_FAIL;
}
hr = InvokeSingleGvim(lpcmi->hwnd,
! lpcmi->lpDirectory,
lpcmi->lpVerb,
lpcmi->lpParameters,
lpcmi->nShow,
--- 776,787 ----
// development.
return E_FAIL;
}
+
+ LPCMINVOKECOMMANDINFOEX lpcmiex = (LPCMINVOKECOMMANDINFOEX)lpcmi;
+ LPCWSTR currentDirectory = lpcmi->cbSize ==
sizeof(CMINVOKECOMMANDINFOEX) ? lpcmiex->lpDirectoryW : NULL;
+
hr = InvokeSingleGvim(lpcmi->hwnd,
! currentDirectory,
lpcmi->lpVerb,
lpcmi->lpParameters,
lpcmi->nShow,
***************
*** 884,890 ****
STDMETHODIMP CShellExt::InvokeSingleGvim(HWND hParent,
! LPCSTR /* pszWorkingDir */,
LPCSTR /* pszCmd */,
LPCSTR /* pszParam */,
int /* iShowCmd */,
--- 888,894 ----
STDMETHODIMP CShellExt::InvokeSingleGvim(HWND hParent,
! LPCWSTR workingDir,
LPCSTR /* pszCmd */,
LPCSTR /* pszParam */,
int /* iShowCmd */,
***************
*** 944,950 ****
FALSE, // Set handle inheritance to FALSE.
0, // No creation flags.
NULL, // Use parent's environment block.
! NULL, // Use parent's starting directory.
&si, // Pointer to STARTUPINFO structure.
&pi) // Pointer to PROCESS_INFORMATION structure.
)
--- 948,954 ----
FALSE, // Set handle inheritance to FALSE.
0, // No creation flags.
NULL, // Use parent's environment block.
! workingDir, // Use parent's starting directory.
&si, // Pointer to STARTUPINFO structure.
&pi) // Pointer to PROCESS_INFORMATION structure.
)
*** ../vim-8.2.3869/src/GvimExt/gvimext.h 2021-07-29 18:18:29.587186625
+0100
--- src/GvimExt/gvimext.h 2021-12-22 15:12:38.130789764 +0000
***************
*** 130,136 ****
int idHWnd);
STDMETHODIMP InvokeSingleGvim(HWND hParent,
! LPCSTR pszWorkingDir,
LPCSTR pszCmd,
LPCSTR pszParam,
int iShowCmd,
--- 130,136 ----
int idHWnd);
STDMETHODIMP InvokeSingleGvim(HWND hParent,
! LPCWSTR workingDir,
LPCSTR pszCmd,
LPCSTR pszParam,
int iShowCmd,
*** ../vim-8.2.3869/src/version.c 2021-12-22 13:18:36.149009225 +0000
--- src/version.c 2021-12-22 15:14:56.386618347 +0000
***************
*** 751,752 ****
--- 751,754 ----
{ /* Add new patch number below this line */
+ /**/
+ 3870,
/**/
--
>From "know your smileys":
*<|:-) Santa Claus (Ho Ho Ho)
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20211222152151.704011C0641%40moolenaar.net.