Skip to content

Commit 22a78b5

Browse files
mao-yiningchrisbra
authored andcommitted
runtime(vim9): remove unnecessary temp variable
closes: #20374 Signed-off-by: Mao-Yining <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 0e8cf80 commit 22a78b5

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

runtime/autoload/dist/vim9.vim

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ vim9script
33
# Vim runtime support library
44
#
55
# Maintainer: The Vim Project <https://github.com/vim/vim>
6-
# Last Change: 2026 May 06
6+
# Last Change: 2026 May 30
77

88
export def IsSafeExecutable(filetype: string, executable: string): bool
99
if empty(exepath(executable))
@@ -131,13 +131,12 @@ enddef
131131
export def Open(file: string)
132132
# disable shellslash for shellescape, required on Windows #17995
133133
if exists('+shellslash') && &shellslash
134-
&shellslash = false
135134
defer setbufvar('%', '&shellslash', true)
135+
&shellslash = false
136136
endif
137137
if &shell == 'pwsh' || &shell == 'powershell'
138-
const shell = &shell
138+
defer setbufvar('%', '&shell', &shell)
139139
setlocal shell&
140-
defer setbufvar('%', '&shell', shell)
141140
endif
142141
if has('unix') && !has('win32unix') && !exists('$WSL_DISTRO_NAME')
143142
Launch($"{Viewer()} {shellescape(file)}")

0 commit comments

Comments
 (0)