Skip to content

Closing environments with ]] - indentation broken #2229

@stefanvdlugt

Description

@stefanvdlugt

Description

When closing off an opened environment by typing ]] the indentation breaks.
A bisect shows this is likely caused by commit f9d07de.

Steps to reproduce

minimal.vim:

set nocompatible
let &runtimepath  = '~/.vim/bundle/vimtex,' . &runtimepath
let &runtimepath .= ',~/.vim/bundle/vimtex/after'
filetype plugin indent on
syntax enable
set shiftwidth=2

minimal.tex:

\documentclass{minimal}
\begin{document}
\begin{definition}
  My definition

\end{document}
  1. vi -u minimal.vim minimal.tex
  2. move cursor to "My definition", press o]].

Expected behavior

\documentclass{minimal}
\begin{document}
\begin{definition}
  My definition
\end{definition}

\end{document}

Actual behavior

\documentclass{minimal}
\begin{document}
\begin{definition}
  My definition
  \end{definition}

\end{document}

Do you use a latexmkrc file?

No

VimtexInfo

System info
  OS: Linux 5.14.15-arch1-1
  Vim version: VIM 8.2 (1-3441)
  Has clientserver: false

VimTeX project: minimal
  base: minimal.tex
  root: /tmp/vimtex
  tex: /tmp/vimtex/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: General
  qf method: LaTeX logfile

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions