diff --git a/package.json b/package.json index d3a17dd..b0db274 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "scopeName": "source.renpy", "path": "./syntaxes/renpy.tmLanguage_2.json", "embeddedLanguages": { - "embedded.python": "python" + "meta.embedded.python": "python" } } ], diff --git a/syntaxes/renpy.tmLanguage_2.json b/syntaxes/renpy.tmLanguage_2.json index c22752a..5b41732 100644 --- a/syntaxes/renpy.tmLanguage_2.json +++ b/syntaxes/renpy.tmLanguage_2.json @@ -14,19 +14,19 @@ "patterns": [ { "comments": "[TODO: REDO] Renpy python block", - "name": "embedded.python.block", - "begin": "^(init\\s-?\\d?\\s?)?(python:)", + "name": "meta.embedded.python.block", + "begin": "^(\\s*)(init\\s-?\\d*\\s?)?(python(\\searly)?(\\sin\\s\\w+)?)", "beginCaptures": { "0": { "patterns": [{ "include": "#renpy-keywords" }] } }, - "end": "^(?=\\S)", + "end": "^\\1(?=\\S)|^(?=\\S)", "patterns": [{ "include": "source.python" }] }, { "comment": "Match begin and end of python one line statements", - "name": "embedded.python.one-line", + "name": "meta.embedded.python.single-line", "begin": "(?<=(\\$|define|default)\\s)", "end": "\\R$", "patterns": [{ "include": "source.python" }]