Skip to content

Commit

Permalink
[LaTeX] Fixups for command names (#3594)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngc92 authored Nov 26, 2022
1 parent 07a4d04 commit f459663
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
10 changes: 5 additions & 5 deletions LaTeX/LaTeX.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ contexts:
latex-newcommand-bare-commandname:
- clear_scopes: 1
- meta_scope: meta.function.identifier.latex
- match: (\\){{letter}}+
- match: (\\){{cmdname}}
scope: entity.name.newcommand.latex
captures:
1: punctuation.definition.backslash.latex
Expand All @@ -179,7 +179,7 @@ contexts:
- clear_scopes: 1
- meta_scope: meta.function.identifier.latex
- include: brace-group-end
- match: (\\){{letter}}+
- match: (\\){{cmdname}}
scope: entity.name.newcommand.latex
captures:
1: punctuation.definition.backslash.latex
Expand All @@ -201,14 +201,14 @@ contexts:
- meta_scope: meta.function.body.latex
# but in principle, a single token is also valid,
# thus either a command sequence ...
- match: (\\){{letter}}+
- match: (\\){{cmdname}}
scope: support.function.general.latex
captures:
1: punctuation.definition.backslash.latex
pop: 1
# or a single, potentially escaped character. no further effort at
# or a single character. no further effort at
# differentiation here
- match: (\\)?\S\b
- match: \S\b
scope: constant.character.escape.latex
captures:
1: punctuation.definition.backslash.latex
Expand Down
8 changes: 8 additions & 0 deletions LaTeX/syntax_test_latex.tex
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,14 @@
\alpha
% ^^^^^^ support.function.general.latex
\newcommand\"{quote}
%^^^^^^^^^^ meta.function.latex keyword.declaration.function.latex storage.modifier.newcommand.latex
% ^^ meta.function.identifier.latex entity.name.newcommand.latex
% ^^^^^^^ meta.function.body.tex meta.group.brace.tex
% ^ punctuation.definition.backslash.latex
% ^ punctuation.definition.group.brace.begin.tex
% ^ punctuation.definition.group.brace.end.tex
\newcommandprefix
%^^^^^^^^^^^^^^^^ support.function.general.latex
Expand Down

0 comments on commit f459663

Please sign in to comment.