Merge branch 'master' into math-mappings

This commit is contained in:
Karl Yngve Lervåg 2015-10-07 00:11:02 +02:00
commit 55ef103cfe
5 changed files with 31 additions and 17 deletions

View File

@ -533,7 +533,6 @@ function! vimtex#wordcount(detailed) " {{{1
setlocal bufhidden=wipe setlocal bufhidden=wipe
setlocal buftype=nofile setlocal buftype=nofile
setlocal cursorline setlocal cursorline
setlocal listchars=
setlocal nobuflisted setlocal nobuflisted
setlocal nolist setlocal nolist
setlocal nospell setlocal nospell

View File

@ -73,7 +73,6 @@ function! vimtex#index#create(index) " {{{1
setlocal concealcursor=nvic setlocal concealcursor=nvic
setlocal conceallevel=0 setlocal conceallevel=0
setlocal cursorline setlocal cursorline
setlocal listchars=
setlocal nobuflisted setlocal nobuflisted
setlocal nolist setlocal nolist
setlocal nospell setlocal nospell

View File

@ -12,6 +12,7 @@ function! vimtex#latexmk#init_options() " {{{1
call vimtex#util#set_default('g:vimtex_latexmk_background', 0) call vimtex#util#set_default('g:vimtex_latexmk_background', 0)
call vimtex#util#set_default('g:vimtex_latexmk_callback', 1) call vimtex#util#set_default('g:vimtex_latexmk_callback', 1)
call vimtex#util#set_default('g:vimtex_latexmk_continuous', 1) call vimtex#util#set_default('g:vimtex_latexmk_continuous', 1)
call vimtex#util#set_default('g:vimtex_latexmk_file_line_error', 1)
call vimtex#util#set_default('g:vimtex_latexmk_options', '') call vimtex#util#set_default('g:vimtex_latexmk_options', '')
call vimtex#util#set_default('g:vimtex_latexmk_progname', call vimtex#util#set_default('g:vimtex_latexmk_progname',
\ get(v:, 'progpath', get(v:, 'progname'))) \ get(v:, 'progpath', get(v:, 'progname')))
@ -392,8 +393,12 @@ function! s:latexmk_build_cmd() " {{{1
endif endif
let cmd .= ' -verbose -pdf ' . g:vimtex_latexmk_options let cmd .= ' -verbose -pdf ' . g:vimtex_latexmk_options
if g:vimtex_latexmk_file_line_error
let cmd .= ' -e ' . vimtex#util#shellescape( let cmd .= ' -e ' . vimtex#util#shellescape(
\ '$pdflatex =~ s/^((.(?<!^internal(?=\s)))*?) /$1 -file-line-error /') \ '$pdflatex =~ s/ / -file-line-error /')
endif
if g:vimtex_latexmk_build_dir !=# '' if g:vimtex_latexmk_build_dir !=# ''
let cmd .= ' -outdir=' . g:vimtex_latexmk_build_dir let cmd .= ' -outdir=' . g:vimtex_latexmk_build_dir
endif endif
@ -431,6 +436,8 @@ function! s:latexmk_build_cmd() " {{{1
else else
let cmd .= ' >' . tmp . ' 2>&1' let cmd .= ' >' . tmp . ' 2>&1'
endif endif
elseif has('win32')
let cmd = 'cmd /c "' . cmd . '"'
endif endif
let exe.cmd = cmd let exe.cmd = cmd

View File

@ -120,19 +120,21 @@ function! vimtex#util#execute(exe) " {{{1
endfunction endfunction
" }}}1 " }}}1
function! vimtex#util#shellescape(path) " {{{1 function! vimtex#util#shellescape(cmd) " {{{1
if has('win32')
"
" Path used in "cmd" only needs to be enclosed by double quotes.
" shellescape() on Windows with "shellslash" set will produce a path
" enclosed by single quotes, which "cmd" does not recognize and reports an
" error.
"
" Blackslashes in path must be escaped to be correctly parsed by the " Blackslashes in path must be escaped to be correctly parsed by the
" substitute() function. " substitute() function.
let l:path = has('win32') ? escape(a:path, '\') : a:path
" "
" In a Windows environment, a path used in "cmd" only needs to be enclosed by return '"' . escape(a:cmd, '\') . '"'
" double quotes. shellescape() on Windows with "shellslash" set will produce else
" a path enclosed by single quotes, which "cmd" does not recognize and return shellescape(a:cmd)
" reports an error. Any path that goes into vimtex#util#execute() should be endif
" processed through this function.
"
return has('win32') ? '"' . l:path . '"' : shellescape(l:path, 1)
endfunction endfunction
" }}}1 " }}}1

View File

@ -528,6 +528,13 @@ Options~
Default value: 1 Default value: 1
*g:vimtex_latexmk_file_line_error*
If enabled, |vimtex| will append the `-file-line-error` argument to `latexmk`.
This will help when parsing the log for errors and warnings, and should be
turned on in most cases.
Default value: 1
*g:vimtex_latexmk_background* *g:vimtex_latexmk_background*
If continuous mode is disabled, then this option may be used to set If continuous mode is disabled, then this option may be used to set
whether single shot compilations should be run in the foreground or the whether single shot compilations should be run in the foreground or the