Skip to content

Issues with LaTeX3 syntax highlighting #3245

@Skillmon

Description

@Skillmon

Description

I found two problems with the syntax highlighting inside the texE3Zone:

  1. texE3Cmd matches things that can't be part of macro names with normal category codes, namely digits. The definition should be changed to
    syntax match texE3Cmd "\\\h\+"
        \ contained containedin=@texClusterE3
        \ nextgroup=texE3Opt,texE3Arg skipwhite skipnl
  2. I don't know why but for some reason the texE3Function matching is overruled by the texSpecialChar matching it seems for L3 functions starting with underscores like \__my_internal_function:n. (This one I really don't know how to fix, hence no PR for this, sorry.)

Steps to reproduce

  1. nvim -u minimal.vim minimal.tex
  2. Use the following TeX code:
    \ExplSyntaxOn
    \@@_internal_command:nn % works, brilliant
    \__my_internal_command:nn % doesn't work, not brilliant

Expected behavior

Nice function-syntax-highlighting for \__my_internal_command

Actual behavior

The \_ part of the name gets syntax highlighting, the rest doesn't.

Do you use a latexmkrc file?

no

VimtexInfo

System info:
  OS: Arch Linux
  LaTeX version: pdfTeX 3.141592653-2.6-1.40.28 (TeX Live 2025)
  Vim version: NVIM v0.11.5
  Has clientserver: true
  Servername: /run/user/1000/nvim.8910.0
  $PATH:
    - /usr/bin
    - /usr/local/bin
    - /usr/local/bin/texbin
    - /usr/local/sbin

VimTeX project: bugreport
  base: bugreport.tex
  root: /home/jps/tmp/tex
  tex: /home/jps/tmp/tex/bugreport.tex
  main parser: fallback current file
  document class: 
  document class options: 
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
  viewer: Zathura
    xwin id: 0
  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