-
Notifications
You must be signed in to change notification settings - Fork 407
vimtex + nvim-cmp crash when typing *some* commands #2653
Description
Description
Hi all,
the good: latex completion using nvim-cmp seems to be working generally. But when I type some commands, nvim and it's containing terminal crash.
For example, in the below MWE, typing \be (e.g., for \begin or \beta) will show completion for commands starting with be, then crash, making vimtex+nvim-cmp impossible to use together. Other latex commands are fine.
The crash always happens when typing \be after \begin{document}, but only about 50% of the time when typed in the preamble. Super weird.
Not sure if related, but with the setup below entering insert mode (by hitting i, a, o, etc) gives this error message:
E5108: Error executing lua [string "v:lua"]:1: attempt to index field 'utils' (a nil value)
stack traceback:
[string "v:lua"]:1: in main chunk
This does not happen with my full config, where the crashes happen, too (and for more commands! e.g. \au, \da, ...)
Steps to reproduce
- Run
nvim -u minimal.vim minimal.tex - Type in the document body:
\be - Observe crash or repeat
minimal.tex
\documentclass{minimal}
\begin{document}
Test
\end{document}minimal.vim
call plug#begin('~/.config/nvim/plugged')
Plug 'hrsh7th/cmp-omni'
Plug 'hrsh7th/nvim-cmp'
Plug 'lervag/vimtex'
call plug#end()
lua << EOF
-- Adjust VimTeX config
vim.g.vimtex_view_method = "zathura"
vim.g.vimtex_syntax_enabled = 0
vim.g.vimtex_quickfix_enabled = 0
-- Setup nvim-cmp
cmp = require("cmp")
cmp.setup {
sources = cmp.config.sources {
{ name = "omni", },
},
}
EOFExpected behavior
Should not crash.
Actual behavior
-
error message whenever entering nvim's insert mode:
E5108: Error executing lua [string "v:lua"]:1: attempt to index field 'utils' (a nil value) stack traceback: [string "v:lua"]:1: in main chunk -
nvim + terminal crash
Do you use a latexmkrc file?
No
VimtexInfo
System info:
OS: Linux 6.2.1-arch1-1
Vim version: NVIM v0.8.3
Has clientserver: true
Servername: /run/user/1000/nvim.72546.0
VimTeX project: minimal
base: minimal.tex
root: /home/david/mwe_tex
tex: /home/david/mwe_tex/minimal.tex
main parser: current file verified
document class: minimal
compiler: latexmk
engine: -pdf
options:
-verbose
-file-line-error
-synctex=1
-interaction=nonstopmode
callback: 1
continuous: 1
executable: latexmk
viewer: Zathura
xwin id: 0