From 39f9298cb2944071b2b19a6b28edf0939aa4312d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AF=9B=E9=80=B8=E5=AE=81?= Date: Sat, 16 Aug 2025 17:38:33 +0200 Subject: [PATCH] runtime(vim9): Disable shellslash for shellescape() in Open() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes: #17995 closes: #18004 Signed-off-by: 毛逸宁 Signed-off-by: Christian Brabandt --- runtime/autoload/dist/vim9.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/runtime/autoload/dist/vim9.vim b/runtime/autoload/dist/vim9.vim index 6d4079ea36..fa14bdaf04 100644 --- a/runtime/autoload/dist/vim9.vim +++ b/runtime/autoload/dist/vim9.vim @@ -3,7 +3,7 @@ vim9script # Vim runtime support library # # Maintainer: The Vim Project -# Last Change: 2025 Jan 29 +# Last Change: 2025 Aug 15 export def IsSafeExecutable(filetype: string, executable: string): bool if empty(exepath(executable)) @@ -121,6 +121,11 @@ def Viewer(): string enddef export def Open(file: string) + # disable shellslash for shellescape, required on Windows #17995 + if exists('+shellslash') && &shellslash + &shellslash = false + defer setbufvar('%', '&shellslash', true) + endif Launch($"{Viewer()} {shellescape(file, 1)}") enddef