From 7531dbc160b4eaccad1b5c0ec2b7dfdeabb43a88 Mon Sep 17 00:00:00 2001 From: Alex Balgavy Date: Wed, 13 Jul 2022 16:24:42 +0200 Subject: [PATCH 1/2] Fix outdir quoting issue for tectonic For the tectonic compiler: if the path to the file contains spaces, outdir is not quoted properly and hence the build command does not work. This commit fixes that by escaping the path with `fnameescape()`. --- autoload/vimtex/compiler/tectonic.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/vimtex/compiler/tectonic.vim b/autoload/vimtex/compiler/tectonic.vim index 73f4d401e2..db0a60e85c 100644 --- a/autoload/vimtex/compiler/tectonic.vim +++ b/autoload/vimtex/compiler/tectonic.vim @@ -38,7 +38,7 @@ endfunction function! s:compiler.__build_cmd() abort dict " {{{1 let l:outdir = !empty(self.build_dir) \ ? self.build_dir - \ : fnamemodify(self.state.tex, ':p:h') + \ : fnamemodify(self.state.tex, ':p:h')->fnameescape() return 'tectonic ' . join(self.options) \ . ' --outdir=' . l:outdir From df0df0382886f33e097bacc5c751d3b1add2045e Mon Sep 17 00:00:00 2001 From: Alex Balgavy Date: Thu, 14 Jul 2022 11:04:25 +0200 Subject: [PATCH 2/2] Escape entire l:outdir instead --- autoload/vimtex/compiler/tectonic.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/vimtex/compiler/tectonic.vim b/autoload/vimtex/compiler/tectonic.vim index db0a60e85c..e3870950c0 100644 --- a/autoload/vimtex/compiler/tectonic.vim +++ b/autoload/vimtex/compiler/tectonic.vim @@ -38,10 +38,10 @@ endfunction function! s:compiler.__build_cmd() abort dict " {{{1 let l:outdir = !empty(self.build_dir) \ ? self.build_dir - \ : fnamemodify(self.state.tex, ':p:h')->fnameescape() + \ : fnamemodify(self.state.tex, ':p:h') return 'tectonic ' . join(self.options) - \ . ' --outdir=' . l:outdir + \ . ' --outdir=' . fnameescape(l:outdir) \ . ' ' . vimtex#util#shellescape(self.state.base) endfunction