]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(vim9): Disable shellslash for shellescape() in Open()
author毛逸宁 <mao.yining@outlook.com>
Sat, 16 Aug 2025 15:38:33 +0000 (17:38 +0200)
committerChristian Brabandt <cb@256bit.org>
Sat, 16 Aug 2025 15:38:33 +0000 (17:38 +0200)
fixes: #17995
closes: #18004

Signed-off-by: 毛逸宁 <mao.yining@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/autoload/dist/vim9.vim

index 6d4079ea36995e953bc6a73244211a7ee8d2fa2d..fa14bdaf04761fef5f2cf59838db00d68979ee6c 100644 (file)
@@ -3,7 +3,7 @@ vim9script
 # Vim runtime support library
 #
 # Maintainer:   The Vim Project <https://github.com/vim/vim>
-# 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