-
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
Yet another \item indentation error #2382
Comments
I believe the problem is that the specified workflow sort of breaks the expectations used for auto indentation here. That is, given: \begin{itemize}
\item first
second
\end{itemize} When you start adding the \begin{itemize}
\item first
\ite|second
\end{itemize} Now continue in insert mode by adding "m", you get: \begin{itemize}
\item first
\itemsecond
\end{itemize} This is because the indentation is triggered by the As a "proof" of this, you can try the same story as above, except add the initial space. That is, do \begin{itemize}
\item first
\ite| second
% continue with "m" →
\item second
\end{itemize} I've tried to thing of a "solution" to this, but I'm afraid I don't immediately see any. Or, one possibility is to relax the regex used for the indentation: Line 233 in 1eeb881
If we remove \begin{env}
Some text where you for some reason break the line here
\itemcmd and continue here with some random command starting with
"\item..". The indentation is now broken.
\end{env} I might consider going for this, as the broken scenario seems very unlikely. But still, we will have to choose between things that are not perfect. I would be happy to hear more opinions on this matter. Or better; suggestions for other ways to handle this. |
Would it be possible to trigger the indentation on |
Yes, that is possible, but it would ruin auto indent on |
Only trigger autoindent after space or [ to avoid unexpected auto indents. refer: #2382
Description
I've tried checking out the other \item indentation error issues but they are either claimed to be resolved or not quite the same as this one, so I'm making a new one.
The problem is this: I have a couple of lines hastily written down like so:
And then when I later go to clean up what I've written, I end up with
What I am doing is first putting the environment around the lines that will become the list, and then insert \item to the front of the line. If I from the beginning write the items in order then the indentation becomes correct.
=ie
does fix it but it's annoying to have to do that all the time.Steps to reproduce
Minimal init.vim:
\begin{itemize}
/\end{itemize}
\item
at the beginning of the two linesThe first one is correctly indented, the second is indented too much
Expected behavior
All \items being indented one tab / four spaces
Actual behavior
Indent level increasing with each \item
Do you use a latexmkrc file?
no
VimtexInfo
The text was updated successfully, but these errors were encountered: