Skip to content

Commit

Permalink
doc: document vimtex#compiler#callback
Browse files Browse the repository at this point in the history
  • Loading branch information
lervag committed Mar 29, 2021
1 parent 6c5e133 commit 66a7621
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions doc/vimtex.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4377,10 +4377,11 @@ priority, so one may want to use custom options if one wants to specify
particular things in a configuration file.

A particular set of options are very convenient for a good coupling between
`latexmk` and Vim: `$compiling_cmd`, `$success_cmd`, and `$failure_cmd`. These options
can be used to specify commands that are run by `latexmk` before and after
compilation. This is used by VimTeX to achieve callbacks after compilation
has finished with something like this: >
`latexmk` and Vim: `$compiling_cmd`, `$success_cmd`, and `$failure_cmd`. These
options can be used to specify commands that are run by `latexmk` before and
after compilation. This is used by VimTeX to achieve callbacks after
compilation has finished through |vimtex#compiler#callback| with something
like this: >
$success_cmd = "gvim --remote-expr 'vimtex#compiler#callback(1)'";
$failure_cmd = "gvim --remote-expr 'vimtex#compiler#callback(0)'";
Expand Down Expand Up @@ -4861,6 +4862,13 @@ Note: This API is currently a work in progress!
Function returns 0 if a compiler is not running, 1 if it is running, or -1
if the compiler backend is not available (e.g. for non VimTeX buffers).

*vimtex#compiler#callback(status)*
Utility function to be used as a compiler callback function. The argument is
the compiler status: 0 or |v:false| means compilation failed and 1 or
|v:true| means compilation was successful. The function does several useful
things based on the status, such as running the |VimtexEventCompileFailed|
and |VimtexEventCompileSuccess| events.

==============================================================================
FAQ *vimtex-faq*

Expand Down

0 comments on commit 66a7621

Please sign in to comment.