Skip to content

Restrict cmd parsing to actual commands #3214

@handcart2034

Description

@handcart2034

Description

Currently any strings that starts with a \ are parsed as a cmd, which is not ideal for vimtex-cmd-toggle-star-agn. For example inside an equation when we try toggling to equation*, sometimes the \pi under the cursor gets toggled to \pi* instead, which doesn't exist at all. This also applies to the ubiquitous \frac, \sin, \left etc.

Personally the few actual commands with starred versions that I encounter are

  • \section, \subsection, etc
  • \cite, \citeauthor, etc
  • \ref, \autoref, etc

There are much fewer of those than the literals above, so maybe a whitelist works? But I am not sure about other users.

Steps to reproduce

No response

Expected behavior

No response

Actual behavior

No response

Do you use a latexmkrc file?

No

VimtexInfo

Not needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions