From 0a9d13c8e2148d92100e114c8604d010f8abf4cc Mon Sep 17 00:00:00 2001 From: tunaflsh Date: Wed, 8 Jan 2025 01:40:29 +0100 Subject: [PATCH] fix(vlty): use proper shellescape on windows --- compiler/vlty.vim | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/compiler/vlty.vim b/compiler/vlty.vim index 1ca3354fdf..3a00661185 100644 --- a/compiler/vlty.vim +++ b/compiler/vlty.vim @@ -28,8 +28,17 @@ if !executable(s:python) call s:installation_error('requires Python') finish endif - -if s:check_python('import sys; assert sys.version_info >= (3, 6)') +" shellescape after the executable check +" needed if s:python = g:python3_host_prog and contains spaces +let s:python = vimtex#util#shellescape(s:python) + +if has('win32') + " escape > with ^ because cmd escape mechanism is weird + if s:check_python('import sys; assert sys.version_info ^>= (3, 6)') + call s:installation_error('requires at least Python version 3.6') + finish + endif +elseif s:check_python('import sys; assert sys.version_info >= (3, 6)') call s:installation_error('requires at least Python version 3.6') finish endif @@ -66,7 +75,7 @@ if s:vlty.server !=# 'lt' finish endif - let s:vlty_lt_command = 'java -jar ' . fnamemodify(s:jarfile, ':S') + let s:vlty_lt_command = 'java -jar ' . vimtex#util#shellescape(s:jarfile) endif endif