summaryrefslogtreecommitdiffstats
path: root/src/clientserver.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 02:10:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 02:10:59 +0000
commitcccb21df3b4c6fe0aaa99743c418aa973aeebad0 (patch)
tree35a2d1f88d47e930fec425da1c1cb89b3ccae6e0 /src/clientserver.c
parentReleasing progress-linux version 2:9.1.0199-1~progress7.99u1. (diff)
downloadvim-cccb21df3b4c6fe0aaa99743c418aa973aeebad0.tar.xz
vim-cccb21df3b4c6fe0aaa99743c418aa973aeebad0.zip
Merging upstream version 2:9.1.0374.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/clientserver.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/clientserver.c b/src/clientserver.c
index 340add3..b19cd44 100644
--- a/src/clientserver.c
+++ b/src/clientserver.c
@@ -608,7 +608,7 @@ build_drop_cmd(
// Call inputsave() so that a prompt for an encryption key works.
ga_concat(&ga, (char_u *)
- "<CR>:if exists('*inputsave')|call inputsave()|endif|");
+ "<CR><C-\\><C-N>:if exists('*inputsave')|call inputsave()|endif|");
if (tabs)
ga_concat(&ga, (char_u *)"tab ");
ga_concat(&ga, (char_u *)"drop");
@@ -652,7 +652,13 @@ build_drop_cmd(
// endif
// endif
ga_concat(&ga, (char_u *)":if !exists('+acd')||!&acd|if haslocaldir()|");
+#ifdef MSWIN
+ // in case :set shellslash is set, need to normalize the directory separators
+ // '/' is not valid in a filename so replacing '/' by '\\' should be safe
+ ga_concat(&ga, (char_u *)"cd -|lcd -|elseif getcwd()->tr('/','\\') ==# '");
+#else
ga_concat(&ga, (char_u *)"cd -|lcd -|elseif getcwd() ==# '");
+#endif
ga_concat(&ga, cdp);
ga_concat(&ga, (char_u *)"'|cd -|endif|endif<CR>");
vim_free(cdp);