@@ -8,8 +8,8 @@ function! vimtex#compiler#init_buffer() abort " {{{1
88 if ! g: vimtex_compiler_enabled | return | endif
99
1010 " Define commands
11- command ! - buffer -nargs =* VimtexCompile call vimtex#compiler#compile (<f -args> )
12- command ! - buffer - bang -nargs =* VimtexCompileSS call vimtex#compiler#compile_ss (<f -args> )
11+ command ! - buffer - bang -nargs =* VimtexCompile call vimtex#compiler#compile (<q -args> , <q-bang > )
12+ command ! - buffer -nargs =* VimtexCompileSS call vimtex#compiler#compile_ss (<q -args> )
1313
1414 command ! - buffer - range VimtexCompileSelected <line1> ,<line2> call vimtex#compiler#compile_selected (' command' )
1515 command ! - buffer VimtexCompileOutput call vimtex#compiler#output ()
@@ -115,10 +115,13 @@ endfunction
115115function ! vimtex#compiler#compile (... ) abort " {{{1
116116 if ! b: vimtex .compiler .enabled | return | endif
117117
118- if b: vimtex .compiler .is_running ()
118+ let l: opts = a: 0 > 0 ? a: 1 : ' '
119+ let l: bang = a: 0 > 1 ? a: 2 == # ' !' : v: false
120+
121+ if ! b: vimtex .compiler .is_running ()
122+ call vimtex#compiler#start (l: opts )
123+ elseif ! l: bang
119124 call vimtex#compiler#stop ()
120- else
121- call call (' vimtex#compiler#start' , a: 000 )
122125 endif
123126endfunction
124127
@@ -132,7 +135,8 @@ function! vimtex#compiler#compile_ss(...) abort " {{{1
132135 return
133136 endif
134137
135- call b: vimtex .compiler .start_single (expandcmd (join (a: 000 )))
138+ let l: opts = a: 0 > 0 ? expandcmd (a: 1 ) : ' '
139+ call b: vimtex .compiler .start_single (l: opts )
136140
137141 if g: vimtex_compiler_silent | return | endif
138142 call vimtex#log#info (' Compiler started in background!' )
@@ -229,7 +233,8 @@ function! vimtex#compiler#start(...) abort " {{{1
229233 return
230234 endif
231235
232- call b: vimtex .compiler .start (expandcmd (join (a: 000 )))
236+ let l: opts = a: 0 > 0 ? expandcmd (a: 1 ) : ' '
237+ call b: vimtex .compiler .start (l: opts )
233238
234239 if g: vimtex_compiler_silent | return | endif
235240
0 commit comments