Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jlelong committed Jan 4, 2024
1 parent 317fe46 commit 39ea1ba
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 13 deletions.
45 changes: 40 additions & 5 deletions syntax/LaTeX.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -1057,20 +1057,55 @@
]
},
{
"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"
}
]
}
},
"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": {
Expand Down
5 changes: 4 additions & 1 deletion syntax/latex-cpp-embedded-language-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"}}
]
}
9 changes: 2 additions & 7 deletions syntax/markdown-latex-combined.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -2258,12 +2258,7 @@
]
}
},
"name": "markup.heading.markdown",
"patterns": [
{
"include": "#inline"
}
]
"name": "markup.heading.markdown"
},
"heading-setext": {
"patterns": [
Expand Down

0 comments on commit 39ea1ba

Please sign in to comment.