Added option g:vimtex_view_automatic
This makes it possible to disable the automatic opening of viewer window when compilation is started.
This commit is contained in:
parent
87e186b4ab
commit
b1d8de600f
@ -587,9 +587,17 @@ function! s:latexmk_build_cmd() " {{{1
|
||||
|
||||
if g:vimtex_latexmk_continuous
|
||||
let cmd .= ' -pvc'
|
||||
if get(b:vimtex.viewer, 'xwin_id', 0) > 0
|
||||
|
||||
"
|
||||
" Set viewer options
|
||||
"
|
||||
if !g:vimtex_view_automatic
|
||||
\ || get(b:vimtex.viewer, 'xwin_id', 0) > 0
|
||||
\ || get(s:, 'silence_next_callback', 0)
|
||||
let cmd .= ' -view=none'
|
||||
elseif g:vimtex_view_enabled
|
||||
\ && has_key(b:vimtex.viewer, 'latexmk_append_argument')
|
||||
let cmd .= b:vimtex.viewer.latexmk_append_argument()
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -603,11 +611,6 @@ function! s:latexmk_build_cmd() " {{{1
|
||||
let s:first_callback = 1
|
||||
endif
|
||||
|
||||
if g:vimtex_view_enabled
|
||||
\ && has_key(b:vimtex.viewer, 'latexmk_append_argument')
|
||||
let cmd .= b:vimtex.viewer.latexmk_append_argument()
|
||||
endif
|
||||
|
||||
let cmd .= ' ' . vimtex#util#shellescape(b:vimtex.base)
|
||||
|
||||
if g:vimtex_latexmk_continuous || g:vimtex_latexmk_background
|
||||
|
@ -8,6 +8,7 @@ function! vimtex#view#init_options() " {{{1
|
||||
call vimtex#util#set_default('g:vimtex_view_enabled', 1)
|
||||
if !g:vimtex_view_enabled | return | endif
|
||||
|
||||
call vimtex#util#set_default('g:vimtex_view_automatic', 1)
|
||||
call vimtex#util#set_default('g:vimtex_view_method', 'general')
|
||||
call vimtex#util#set_default('g:vimtex_view_use_temp_files', 0)
|
||||
endfunction
|
||||
|
@ -20,7 +20,7 @@ function! vimtex#view#common#use_temp_files_p(viewer) " {{{1
|
||||
let a:viewer.copy_files = function('s:copy_files')
|
||||
else
|
||||
let a:viewer.out = b:vimtex.out()
|
||||
let a:viewer.synctex = b:vimtex.ext('synctex.gz')
|
||||
let a:viewer.synctex = fnamemodify(a:viewer.out, ':r') . '.synctex.gz'
|
||||
endif
|
||||
|
||||
return a:viewer
|
||||
|
@ -127,7 +127,9 @@ function! s:mupdf.latexmk_callback(status) dict " {{{1
|
||||
|
||||
if g:vimtex_view_use_temp_files
|
||||
call self.copy_files()
|
||||
else
|
||||
endif
|
||||
|
||||
if g:vimtex_view_automatic
|
||||
"
|
||||
" Search for existing window created by latexmk
|
||||
" It may be necessary to wait some time before it is opened and
|
||||
@ -140,18 +142,17 @@ function! s:mupdf.latexmk_callback(status) dict " {{{1
|
||||
if self.xwin_exists() | break | endif
|
||||
endfor
|
||||
endif
|
||||
endif
|
||||
|
||||
if !self.xwin_exists() && !has_key(self, 'started_through_callback')
|
||||
call self.start(self.out)
|
||||
let self.started_through_callback = 1
|
||||
if !self.xwin_exists() && !has_key(self, 'started_through_callback')
|
||||
call self.start(self.out)
|
||||
let self.started_through_callback = 1
|
||||
endif
|
||||
endif
|
||||
|
||||
if g:vimtex_view_use_temp_files
|
||||
call self.xwin_send_keys('r')
|
||||
endif
|
||||
|
||||
call self.xwin_send_keys(g:vimtex_view_mupdf_send_keys)
|
||||
if has_key(self, 'hook_callback')
|
||||
call self.hook_callback()
|
||||
endif
|
||||
|
@ -74,7 +74,9 @@ function! s:zathura.latexmk_callback(status) dict " {{{1
|
||||
|
||||
if g:vimtex_view_use_temp_files
|
||||
call self.copy_files()
|
||||
else
|
||||
endif
|
||||
|
||||
if g:vimtex_view_automatic
|
||||
"
|
||||
" Search for existing window created by latexmk
|
||||
" It may be necessary to wait some time before it is opened and
|
||||
@ -87,11 +89,11 @@ function! s:zathura.latexmk_callback(status) dict " {{{1
|
||||
if self.xwin_exists() | break | endif
|
||||
endfor
|
||||
endif
|
||||
endif
|
||||
|
||||
if !self.xwin_exists() && !has_key(self, 'started_through_callback')
|
||||
call self.start(self.out)
|
||||
let self.started_through_callback = 1
|
||||
if !self.xwin_exists() && !has_key(self, 'started_through_callback')
|
||||
call self.start(self.out)
|
||||
let self.started_through_callback = 1
|
||||
endif
|
||||
endif
|
||||
|
||||
if has_key(self, 'hook_callback')
|
||||
|
@ -807,6 +807,12 @@ Options~
|
||||
|
||||
Default value: 1
|
||||
|
||||
*g:vimtex_view_automatic*
|
||||
If enabled, the viewer will open automatically when compilation is started
|
||||
in continuous mode. This is the default behaviour of `latexmk`.
|
||||
|
||||
Default value: 1
|
||||
|
||||
*g:vimtex_view_use_temp_files*
|
||||
If enabled, this will copy output files to a corresponding set of files
|
||||
with `_vimtex` prepended to the name. If one combines this with the callback
|
||||
@ -1892,6 +1898,7 @@ viewer is opened.
|
||||
|
||||
Associated settings:
|
||||
|g:vimtex_view_enabled|
|
||||
|g:vimtex_view_automatic|
|
||||
|g:vimtex_view_method|
|
||||
|g:vimtex_view_use_temp_files|
|
||||
|g:vimtex_view_general_viewer|
|
||||
|
Loading…
x
Reference in New Issue
Block a user