Skip to content

Toggle Surrounding Environment Error when Exclamation Point in Environment Name #2360

@ZaydH

Description

@ZaydH

Description

Toggling the surrounding environment (tse) on an environment with an exclamation point deletes the environment and replaces it with *.

I reported a similar issue around optidef previously (#2334) -- specifically relating to cse.

Steps to reproduce

Initial Step: nv -u minimal.vim minimal.tex

In the LaTeX file below, I put my cursor inside the curly brackets for the line \begin{mini!}. In vim command mode, I press tse inside the term mini!.

MWE:

% minimal.tex
\documentclass[10pt]{article}

\usepackage{optidef}

\begin{document}
  \begin{mini!}
    {w}{z}{}{}
    \addConstraint{X}
  \end{mini!}
\end{document}
" minimal.vim
call plug#begin()
Plug 'lervag/vimtex'
call plug#end()

Expected behavior

To disable the per-line equation numbering for the optidef environment, the exclamation point needs to be removed. I am not confident this is the right general behavior. It may be better that for optidef vimtex just prints an error. It should not just delete the environment though.

Actual behavior

The environment just becomes * deleting the environment text mini!

Do you use a latexmkrc file?

N/A

VimtexInfo

System info:
  OS: Pop!_OS 21.10
  Vim version: NVIM v0.4.4
  Has clientserver: true
  Servername: /tmp/nviml1MqI1/0
  
VimTeX project: minimal
  base: minimal.tex  
  root: /home/zayd/repos/all_in_paper/workshop
  tex: /home/zayd/repos/all_in_paper/workshop/minimal.tex
  main parser: current file verified
  document class: article
  packages: optidef
  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