Skip to content

Setting vimtex_indent_lists to empty will make all environments behave like list instead #2846

@user202729

Description

@user202729

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions