Skip to content

Renaming a verbatim env breaks highlighting #4136

@muzimuzhi

Description

@muzimuzhi

Environment

  • TeXstudio: 4.8.8 (git 4.8.8)
  • Qt: 6.9.1, compiled with Qt 6.9.1 R
  • OS: macOS 14.7.2
  • TeX distribution: basicTeX 2025

Expected behavior

Renaming a verbatim environment to another verbatim-like env doesn't break highlighting, or there is an easy way to refresh highlighting.

Actual behavior

After renaming, the highlighting for verbatim content is no longer ended by \end{<envname>}.

How to reproduce

\documentclass{article}

\begin{document}
\begin{verbatim}
content
\end{verbatim}
\end{document}
  1. Put cursor at \begin{verbatim|}, wait for detection of the matching \end{verbatim}
  2. Insert * and watch the broken highlighting
  3. Idefix - Refresh Structure doesn't help. Commenting out the whole env then uncommenting works.
Screen.Recording.2025-08-10.at.01.22.48.mov

Interestingly, if the cursor is put at \end{verbatim|}, then an insertion of * doesn't break the highlighting of verbatim content, but the envname verbatim* in \end{verbatim}.

Screen.Recording.2025-08-10.at.01.28.59.mov

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions