diff --git a/autoload/latex/latexmk.vim b/autoload/latex/latexmk.vim index 42c9924..937c039 100644 --- a/autoload/latex/latexmk.vim +++ b/autoload/latex/latexmk.vim @@ -116,7 +116,13 @@ function! latex#latexmk#errors() execute 'cgetfile ' . log endif - botright cwindow + if g:latex_latexmk_quickfix + botright cwindow + if g:latex_latexmk_quickfix == 2 + wincmd p + endif + redraw! + endif endfunction " {{{1 latex#latexmk#status diff --git a/doc/latex.txt b/doc/latex.txt index 8d57b14..f626e7d 100644 --- a/doc/latex.txt +++ b/doc/latex.txt @@ -214,6 +214,7 @@ Overview:~ |g:latex_latexmk_enabled| |g:latex_latexmk_options| |g:latex_latexmk_output| + |g:latex_latexmk_quickfix| |g:latex_main_tex_candidates| |g:latex_mappings_enabled| |g:latex_motion_enabled| @@ -322,6 +323,20 @@ Set extra options for latexmk compilation. > *g:latex_latexmk_output* Set desired output for latexmk compilation. > let g:latex_latexmk_output = 'pdf' +< + *g:latex_latexmk_quickfix* +Adjust the behavior of the quickfix window when there are compilation errors or +warnings. The recognized options are: + + Value Effect ~ + 0 The quickfix window is not opened automatically. + 1 The quickfix window is opened automatically when there are errors, and + it becomes the active window. + 2 The quickfix window is opened automatically when there are errors, but + it does not become the active window. + +The default value is: > + let g:latex_latexmk_quickfix = 2 < *g:latex_main_tex_candidates* A list of common names for main tex-file candidates. This is used to find the diff --git a/ftplugin/tex.vim b/ftplugin/tex.vim index 1b54be4..bdbc37e 100644 --- a/ftplugin/tex.vim +++ b/ftplugin/tex.vim @@ -52,6 +52,7 @@ call latex#util#set_default('g:latex_latexmk_enabled', 1) call latex#util#set_default('g:latex_latexmk_options', '') call latex#util#set_default('g:latex_latexmk_output', 'pdf') call latex#util#set_default('g:latex_latexmk_autojump', '0') +call latex#util#set_default('g:latex_latexmk_quickfix', '2') call latex#util#set_default('g:latex_main_tex_candidates', \ [ \ 'main',