-
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
Setting vimtex_indent_lists to empty will make all environments behave like list instead #2846
Comments
Sorry, that's fixed now!
This is partly intentional; the list is a list of regexes and the user has flexibility to make it more or less strict.
You mean the default value? Or some other explicit setting?
I mean, we can look backward - I do that a lot. But it is quite expensive, so I try to avoid things like that.
Sorry about my confusion, but what are you trying to achieve? The point of the option is to allow users flexibility in when to indent the |
I see. Maybe mention in the documentation (and also documentation of related settings such as
Ah I see. (the following code is consider "correctly indented" by vimtex.)
I originally thought of: if I suppose not much point changing then. |
Yes, good point. I'll fix that as well.
Yes, this output is as expected (by me). The last
Ok, I see. If I did find a good way to implement this feature I think I would like to do it, and instead have an option to toggle it on/off. I believe users who want to indent I could try to do a lookahead and count |
Yes it's difficult to implement, plus a bunch of nesting issue. (current environment is not itemize but there's a nested environment inside that is itemize / \item inside verbatim / etc.) I don't think it's worth it either. |
As in the title.
The suggestion to set this variable to
[]
was made in #2599 , but it doesn't seem to behave the expected way.This is caused by the code:
https://github.com/lervag/vimtex/blob/master/indent/tex.vim#L234-L237
if the list is empty, the regex being constructed end up being
\\end{\%(\)
, which matches the end delimiter of every environment.Side note, in the current situation it will also match any environment name that starts with one of the items in the list.
Side note 2, actually this explicit setting of
g:vimtex_indent_lists
is only necessary because vimtex cannot look backward in the document to see whether any occurrence of\item
appeared in the current environment, right? Otherwise we can just look behind to see if any string\item
appeared in the current environment (and not in any nested environment, which can be annoying to implement anyway)The text was updated successfully, but these errors were encountered: