From 39ea1ba1c4d22a83980c4ddc03233e175e5be935 Mon Sep 17 00:00:00 2001 From: Jerome Lelong Date: Thu, 4 Jan 2024 17:56:33 +0100 Subject: [PATCH] Update to jlelong/vscode-latex-basics@2e1d0da3d916428cd687fb5abd044c6c1162d5c5 --- syntax/LaTeX.tmLanguage.json | 45 ++++++++++++++++--- ...x-cpp-embedded-language-configuration.json | 5 ++- .../markdown-latex-combined.tmLanguage.json | 9 +--- 3 files changed, 46 insertions(+), 13 deletions(-) diff --git a/syntax/LaTeX.tmLanguage.json b/syntax/LaTeX.tmLanguage.json index 553aabc19..6b8ce3671 100644 --- a/syntax/LaTeX.tmLanguage.json +++ b/syntax/LaTeX.tmLanguage.json @@ -148,8 +148,8 @@ ] }, { - "begin": "(^\\s*)?\\\\begin\\{(lstlisting|minted|pyglist)\\}(?=\\[|\\{)", - "end": "\\\\end\\{(?:minted|lstlisting|pyglist)\\}", + "begin": "(?:^\\s*)?\\\\begin\\{(lstlisting|minted|pyglist)\\}(?=\\[|\\{)", + "end": "\\\\end\\{\\1\\}", "captures": { "0": { "patterns": [ @@ -1057,9 +1057,10 @@ ] }, { - "begin": "((?:\\s*)\\\\begin\\{([a-zA-Z]*code|lstlisting|minted|pyglist)(?:\\*)?\\}(?:\\[.*\\])?(?:\\{.*\\})?)", + "begin": "\\s*\\\\begin\\{([a-zA-Z]*code|lstlisting|minted|pyglist)\\*?\\}(?:\\[.*\\])?(?:\\{.*\\})?", + "end": "\\\\end\\{\\1\\}(?:\\s*\\n)?", "captures": { - "1": { + "0": { "patterns": [ { "include": "#begin-env-tokenizer" @@ -1067,10 +1068,44 @@ ] } }, - "end": "(\\\\end\\{\\2\\}(?:\\s*\\n)?)", "contentName": "meta.function.embedded.latex", "name":"meta.embedded.block.generic.latex" }, + { + "begin": "(?:^\\s*)?\\\\begin\\{(terminal\\*?)\\}(?=\\[|\\{)", + "end": "\\\\end\\{\\1\\}", + "captures": { + "0": { + "patterns": [ + { + "include": "#begin-env-tokenizer" + } + ] + } + }, + "patterns": [ + { + "include": "#multiline-optional-arg-no-highlight" + }, + { + "begin": "(?:\\G|(?<=\\]))(\\{)([a-zA-Z]*)(\\})", + "beginCaptures": { + "1": { + "name": "punctuation.definition.arguments.begin.latex" + }, + "2": { + "name": "variable.parameter.function.latex" + }, + "3": { + "name": "punctuation.definition.arguments.end.latex" + } + }, + "contentName": "meta.function.embedded.latex", + "end": "^\\s*(?=\\\\end\\{terminal\\*?\\})", + "name": "meta.embedded.block.generic.latex" + } + ] + }, { "begin": "((\\\\)addplot)(?:\\+?)((?:\\[[^\\[]*\\]))*\\s*(gnuplot)\\s*((?:\\[[^\\[]*\\]))*\\s*(\\{)", "captures": { diff --git a/syntax/latex-cpp-embedded-language-configuration.json b/syntax/latex-cpp-embedded-language-configuration.json index 527bd38bc..bc65b10f7 100644 --- a/syntax/latex-cpp-embedded-language-configuration.json +++ b/syntax/latex-cpp-embedded-language-configuration.json @@ -33,5 +33,8 @@ "start": "^\\s*#pragma\\s+region\\b", "end": "^\\s*#pragma\\s+endregion\\b" } - } + }, + "onEnterRules": [ + {"previousLineText":"^\\s*(((else ?)?if|for|while)\\s*\\(.*\\)\\s*|else\\s*)$", "beforeText":"^\\s+([^{i\\s]|i(?!f\\b))", "action":{"indent":"outdent"}} + ] } diff --git a/syntax/markdown-latex-combined.tmLanguage.json b/syntax/markdown-latex-combined.tmLanguage.json index b271ba704..4be4dee77 100644 --- a/syntax/markdown-latex-combined.tmLanguage.json +++ b/syntax/markdown-latex-combined.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/microsoft/vscode-markdown-tm-grammar/commit/0a4b23580308fdcfb4ab7b526e3e13ba17d436fb", + "version": "https://github.com/microsoft/vscode-markdown-tm-grammar/commit/0b36cbbf917fb0188e1a1bafc8287c7abf8b0b37", "name": "Markdown", "scopeName": "text.tex.markdown_latex_combined", "patterns": [ @@ -2258,12 +2258,7 @@ ] } }, - "name": "markup.heading.markdown", - "patterns": [ - { - "include": "#inline" - } - ] + "name": "markup.heading.markdown" }, "heading-setext": { "patterns": [