If one is currently typing out a snippet in a TeX file with UltiSnips, it will often stop working mid-writing if Vimtexs quickfix menu pops-up. The most common and annoying example is when writing using an environment snippet
Expected behavior:
When using a snippet such as this one:
snippet env "New environment" bA
\begin{$1}
${0:${VISUAL:}}
\end{$1}
endsnippet
once you begin typing an environment, such as say, itemize, and jumping with JumpForwardTrigger, you get this:
\begin{itemize}
"your cursor is now here"
\end{itemize}
and now you can continue typing in your snippet.
Actual behavior:
as you start to type, if the LaTeX document compiles in the meanwhile, it will likely produce an error, which will pop up in the quickfix menu below, after this, your snippet no longer works, what you type in the \begin{} is no longer reproduced in the \end{}, and you can no longer use the jump key to jump to the next tabstop. The end result is your text looking something like this:
\begin{itemize}
\end{ite}
the end command is broken and you have to reach down to fix it manually.
Steps to reproduce
In order for your file in Vimtex to compile after every edit, you need something like this in your vimrc:
Also, obviously, you need Vimtex installed for the continuous compilation, and, while you're editing, you need to turn continuous compilation on with "localleader" ll.
Extra note
It should be noted that this error will always happen when you start writing an environment, because at some point while you're writing you will have an environment name such as ite, which is incomplete, and LaTeX will complain that this environment doesn't exist.
Workarounds
Disable the autocmd line in your vimrc, so the LaTeX file compiles only when you explicitly ":w" it.
Completely disable quickfix error messages, but this is a problem, because you can't see if something is wrong with your file
Type the environment name really, really, really, faaast, so the compilation error doesn't have time to happen
Operating System: Artix Linux
Vim Version: 9.0 Included patches 1-1337
UltiSnips Version: 3.2 current commit: 0ad238b1910d447476b2d98f593322c1cdb71285
Python inside Vim: 3.10.9
Docker repo/vimrc: the vimrc and ftplugin/tex.vim needed to reproduce the bug are small enough for me to include them here:
vimrc:
call plug#begin('~/.vim/plugged')
Plug 'lervag/vimtex'
Plug 'SirVer/ultisnips'
let g:UltiSnipsSnippetDirectories = [$HOME.'/.vim/UltiSnips']
call plug#end()
If one is currently typing out a snippet in a TeX file with UltiSnips, it will often stop working mid-writing if Vimtexs quickfix menu pops-up. The most common and annoying example is when writing using an environment snippet
Expected behavior: When using a snippet such as this one:
once you begin typing an environment, such as say, itemize, and jumping with JumpForwardTrigger, you get this:
and now you can continue typing in your snippet.
Actual behavior: as you start to type, if the LaTeX document compiles in the meanwhile, it will likely produce an error, which will pop up in the quickfix menu below, after this, your snippet no longer works, what you type in the \begin{} is no longer reproduced in the \end{}, and you can no longer use the jump key to jump to the next tabstop. The end result is your text looking something like this:
the end command is broken and you have to reach down to fix it manually.
Steps to reproduce In order for your file in Vimtex to compile after every edit, you need something like this in your vimrc:
Also, obviously, you need Vimtex installed for the continuous compilation, and, while you're editing, you need to turn continuous compilation on with "localleader" ll.
Extra note It should be noted that this error will always happen when you start writing an environment, because at some point while you're writing you will have an environment name such as ite, which is incomplete, and LaTeX will complain that this environment doesn't exist.
Workarounds
Plug 'lervag/vimtex' Plug 'SirVer/ultisnips'
let g:UltiSnipsSnippetDirectories = [$HOME.'/.vim/UltiSnips'] call plug#end()
autocmd TextChanged,InsertLeave *.tex silent update
let g:vimtex_quickfix_mode = 2 let g:vimtex_quickfix_open_on_warning = 0