runtime(vim9): remove unnecessary temp variable

Commit: 
https://github.com/vim/vim/commit/22a78b5de72099e6f063dfbc2ab1daebc25f3ae6
Author: Mao-Yining <[email protected]>
Date:   Sat May 30 18:31:45 2026 +0000

    runtime(vim9): remove unnecessary temp variable
    
    closes: https://github.com/vim/vim/issues/20374
    
    Signed-off-by: Mao-Yining <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/runtime/autoload/dist/vim9.vim b/runtime/autoload/dist/vim9.vim
index cd4022aba..a8bb4f95d 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 <https://github.com/vim/vim>
-# Last Change:  2026 May 06
+# Last Change:  2026 May 30
 
 export def IsSafeExecutable(filetype: string, executable: string): bool
   if empty(exepath(executable))
@@ -131,13 +131,12 @@ enddef
 export def Open(file: string)
   # disable shellslash for shellescape, required on Windows #17995
   if exists('+shellslash') && &shellslash
-    &shellslash = false
     defer setbufvar('%', '&shellslash', true)
+    &shellslash = false
   endif
   if &shell == 'pwsh' || &shell == 'powershell'
-    const shell = &shell
+    defer setbufvar('%', '&shell', &shell)
     setlocal shell&
-    defer setbufvar('%', '&shell', shell)
   endif
   if has('unix') && !has('win32unix') && !exists('$WSL_DISTRO_NAME')
     Launch($"{Viewer()} {shellescape(file)}")

-- 
-- 
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 visit 
https://groups.google.com/d/msgid/vim_dev/E1wTOgC-00EjvN-0j%40256bit.org.

Raspunde prin e-mail lui