Skip to content

Alone [ in command with @ confuses highlight #2094

@Rmano

Description

@Rmano

In (very rare) cases you have a command using \@ifnextchar (from the LaTeX kernel routines). When the checked char is [, the syntax highlighter got confused:

\documentclass{article}
\makeatletter
\def\something{\@ifnextchar[{\addtunablearrow@full}{\addtunablearrow@simple}}%
\makeatother

\begin{document}

Normal text here

\end{document}

image

Using this minimal vimrc:

set nocompatible
let &rtp  = '~/.vim/plugged/vimtex,' . &rtp
let &rtp .= ',~/.vim/plugged/vimtex/after'
filetype plugin indent on
syntax enable

Now --- this is a very special case, I know, so it's not high-priority at all. Is there a way to "reset" it? (adding a comment with %] does not suffice...)

Output from VimtexInfo

  base: open-square.tex
  root: /home/romano/software/bugs/vimtex
  tex: /home/romano/software/bugs/vimtex/open-square.tex
  out: 
  log: 
  aux: 
  fls: 
  main parser: current file verified
  compiler: latexmk
    configuration: 
      continuous: 1
      callback: 1
      latexmk options:
        -verbose
        -file-line-error
        -synctex=1
        -interaction=nonstopmode
      latexmk engine: -pdf
  viewer: General
  qf: LaTeX logfile
    addqflist: 51
    fix_paths: 52
    set_errorformat: 50
  document class: article

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions