diff --git a/autoload/vimtex.vim b/autoload/vimtex.vim index 7539000..16195c6 100644 --- a/autoload/vimtex.vim +++ b/autoload/vimtex.vim @@ -533,7 +533,6 @@ function! vimtex#wordcount(detailed) " {{{1 setlocal bufhidden=wipe setlocal buftype=nofile setlocal cursorline - setlocal listchars= setlocal nobuflisted setlocal nolist setlocal nospell diff --git a/autoload/vimtex/index.vim b/autoload/vimtex/index.vim index f7140a1..69dc44c 100644 --- a/autoload/vimtex/index.vim +++ b/autoload/vimtex/index.vim @@ -73,7 +73,6 @@ function! vimtex#index#create(index) " {{{1 setlocal concealcursor=nvic setlocal conceallevel=0 setlocal cursorline - setlocal listchars= setlocal nobuflisted setlocal nolist setlocal nospell diff --git a/autoload/vimtex/latexmk.vim b/autoload/vimtex/latexmk.vim index 3f64b4a..08f9072 100644 --- a/autoload/vimtex/latexmk.vim +++ b/autoload/vimtex/latexmk.vim @@ -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_callback', 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_progname', \ get(v:, 'progpath', get(v:, 'progname'))) @@ -392,8 +393,12 @@ function! s:latexmk_build_cmd() " {{{1 endif let cmd .= ' -verbose -pdf ' . g:vimtex_latexmk_options - let cmd .= ' -e ' . vimtex#util#shellescape( - \ '$pdflatex =~ s/^((.(?' . tmp . ' 2>&1' endif + elseif has('win32') + let cmd = 'cmd /c "' . cmd . '"' endif let exe.cmd = cmd diff --git a/autoload/vimtex/util.vim b/autoload/vimtex/util.vim index db1c0ea..e7fab23 100644 --- a/autoload/vimtex/util.vim +++ b/autoload/vimtex/util.vim @@ -120,19 +120,21 @@ function! vimtex#util#execute(exe) " {{{1 endfunction " }}}1 -function! vimtex#util#shellescape(path) " {{{1 - " Blackslashes in path must be escaped to be correctly parsed by the - " 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 - " 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. Any path that goes into vimtex#util#execute() should be - " processed through this function. - " - return has('win32') ? '"' . l:path . '"' : shellescape(l: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 + " substitute() function. + " + return '"' . escape(a:cmd, '\') . '"' + else + return shellescape(a:cmd) + endif endfunction " }}}1 diff --git a/doc/vimtex.txt b/doc/vimtex.txt index 86368e3..bdccf82 100644 --- a/doc/vimtex.txt +++ b/doc/vimtex.txt @@ -528,6 +528,13 @@ Options~ 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* 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