Skip to content

Commit

Permalink
fix: Don't do timeout in pvc mode after inactivity
Browse files Browse the repository at this point in the history
By default the `-pvc` mode will stop working after 30 mins of inactivity,
where vimtex compiler and the latexmk process can fall into an
inconsistent state (i.e., no longer able to build the latex project
while vimtex still thinks the continuous mode is still running).

To prevent this, we disable inactivity timeout in the pvc mode.
Requires latexmk v4.55 (Jan 2018) or higher.

From https://texdoc.org/serve/latexmk/0

```
-pvctimeout
    Do timeout in pvc mode after period of inactivity, which is 30 min.
    by default. Inactivity means a period when latexmk has detected no
    file changes and hence has not taken any actions like compiling the
    document.

-pvctimeout-
    Don’t do timeout in pvc mode after inactivity.
```
  • Loading branch information
wookayin committed Oct 4, 2023
1 parent 7d453a6 commit fb2d07c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions autoload/vimtex/compiler/latexmk.vim
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function! s:compiler.__build_cmd() abort dict " {{{1
endif

if self.continuous
let l:cmd .= ' -pvc -view=none'
let l:cmd .= ' -pvc -pvctimeout- -view=none'

if self.callback
for [l:opt, l:val] in [
Expand All @@ -164,7 +164,7 @@ function! s:compiler.__pprint_append() abort dict " {{{1
if !empty(self.aux_dir)
call add(l:list, ['aux_dir', self.aux_dir])
endif

call add(l:list, ['callback', self.callback])
call add(l:list, ['continuous', self.continuous])
call add(l:list, ['executable', self.executable])
Expand Down

0 comments on commit fb2d07c

Please sign in to comment.