-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad \item indent when coc.nvim completion box is displayed #2179
Comments
Again, as in #2156, this is not a VimTeX issue. I'm quite certain it is a conflict with the completion menu and that it may not be easy to fix, but I've opened an issue at the coc.nvim repo to check. It may be closed quickly, but it may also turn out that this is indeed a bug that can be resolved. |
@lervag I hope this is the correct place to put this — let me know if I should make a new issue. After some discussion in the coc.nvim issue you mentioned, you pushed this workaround to the VimTeX repo. I've found this doesn't work properly for certain values of tabstop and shiftwidth when noexpandtab is set on nvim 0.7 and vim 8.2 Here's a minimal.vim for Neovim: lua require("packer").startup(function() use "lervag/vimtex" end)
set noexpandtab
set tabstop=4
set shiftwidth=0 and a minimal.tex: \documentclass{minimal}
\begin{document}
\begin{enumerate}
\item Foo.
\end{enumerate}
\end{document} To reproduce, go to the line containing the \item and press
This will give \i |tem instead of the expected \item | (Here | is the cursor.) |
I looked into it, and it seems it works well when I simplify the code. This may introduce a regression, but I tried to find a case where the code I removed actually does anything useful and I couldn't... crossing my fingers. 🤞🏻 |
Description
This is probably related to this issue (#2156) that I opened a few weeks ago, but I later noticed that YouCompleteMe was also breaking some of my UltiSnips snippets, so I switched from YCM to coc.nvim and the issue seemed to be gone.
But the problem reappeared sometimes, and I couldn't find a way to consistently reproduce it until today.
The problem is still the same : sometimes, typing
\item
in insert mode will not properly indent the current line.Steps to reproduce
minivimrc
:MWE
test.tex
:On the third line of this file (starting in
normal
mode):o\item
fast enough so that coc.nvim's completion box does not have time to appear, the new\item
gets properly aligned with the others;o\item
more slowly - for instance by typingo\ite
, then waiting for coc.nvim's completion box to appear (it will suggestitem
anditemize
on this example), then typingm
to finish writing\item
- the new\item
does not get properly aligned and I get the following:Expected behavior
For
\item
to be properly idented even when coc.nvim's completion box is displayed.Actual behavior
A new
\item
is not properly indented when coc.nvim's completion box is displayed while typing it.I'm guessing the problem comes from a completion box being displayed while typing
\item
, whether using coc.nvim or another completion plugin.Do you use a latexmkrc file?
Yes
VimtexInfo
The text was updated successfully, but these errors were encountered: