From 96d16df15dbe57d71663e385bd1bcb854c534462 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Sun, 13 Nov 2022 14:00:38 +0100 Subject: [PATCH] [TeX] Move most basic prototype like contexts to the end Apply an top-down principle to have most basic contexts at the end of a document and the organizational ones at the beginning - just like a tree. Readability may be improved by grouping contexts visually via delimiter comments. See also: Java, PHP, ... --- LaTeX/TeX.sublime-syntax | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/LaTeX/TeX.sublime-syntax b/LaTeX/TeX.sublime-syntax index 4a7277cbf6..4de13c1de2 100644 --- a/LaTeX/TeX.sublime-syntax +++ b/LaTeX/TeX.sublime-syntax @@ -80,20 +80,6 @@ contexts: - include: general-constants - include: general-commands - # matches any nospace and pops the context - else-pop: - - match: (?=\S) - pop: true - - immediately-pop: - - match: '' - pop: true - - # pops out of the current context if there is a new paragraph - paragraph-pop: - - match: ^(?=\s*$) - pop: true - general-commands: - match: (\\){{letter}}+ scope: support.function.general.tex @@ -399,3 +385,19 @@ contexts: scope: string.other.math.tex punctuation.definition.string.end.tex pop: true - include: math-content + +###[ PROTOTYPES ]############################################################## + + # matches any nospace and pops the context + else-pop: + - match: (?=\S) + pop: true + + immediately-pop: + - match: '' + pop: true + + # pops out of the current context if there is a new paragraph + paragraph-pop: + - match: ^(?=\s*$) + pop: true