Skip to content

Commit

Permalink
chore: minor improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
lervag committed Jul 4, 2021
1 parent 196eedf commit c1e0246
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions autoload/vimtex/compiler/latexmk.vim
Original file line number Diff line number Diff line change
Expand Up @@ -626,13 +626,15 @@ endfunction
" Utility functions
"
function! s:wrap_option_appendcmd(name, value) abort " {{{1
" Do not use with $ in value. On linux, we use double quoted perl strings
" that interpolate.
" Note: On Linux, we use double quoted perl strings; these interpolate
" variables. One should therefore NOT pass values that contain `$`.
let l:win_cmd_sep = has('nvim') ? '^&' : '&'
let l:common = a:name . ' = ($' . a:name . ' ? $' . a:name
let l:common = printf('$%s = ($%s ? $%s', a:name, a:name, a:name)
return has('win32')
\ ? ' -e "$' . l:common . ' . '' ' . l:win_cmd_sep . ' '' : '''') . ''' . a:value . '''"'
\ : ' -e ''$' . l:common . ' . " ; " : "") . "' . a:value . '"'''
\ ? printf(' -e "%s . '' %s '' : '''') . ''%s''"',
\ l:common, l:win_cmd_sep, a:value)
\ : printf(' -e ''%s . " ; " : "") . "%s"''',
\ l:common, a:value)
endfunction

"}}}1

0 comments on commit c1e0246

Please sign in to comment.