diff --git a/Package/Sublime Text Snippet/Sublime Text Snippet (Raw).sublime-syntax b/Package/Sublime Text Snippet/Sublime Text Snippet (Raw).sublime-syntax index 6d6513ef..44a383e0 100644 --- a/Package/Sublime Text Snippet/Sublime Text Snippet (Raw).sublime-syntax +++ b/Package/Sublime Text Snippet/Sublime Text Snippet (Raw).sublime-syntax @@ -67,7 +67,9 @@ contexts: - match: (?=/) pop: true - match: '' - push: scope:source.regexp - with_prototype: + push: + # Will not work if extended mode is enabled in the regex + - meta_scope: source.regexp.embedded - match: (?=/) pop: true + - include: scope:source.regexp#base-literal diff --git a/Package/Sublime Text Snippet/syntax_test_snippet.xml b/Package/Sublime Text Snippet/syntax_test_snippet.xml index 030a0687..de5b0cda 100644 --- a/Package/Sublime Text Snippet/syntax_test_snippet.xml +++ b/Package/Sublime Text Snippet/syntax_test_snippet.xml @@ -206,6 +206,11 @@ It is possible to include a literal newline in the replacement: ${1/test/_ #^ keyword.other.regex.end # ^ keyword.other.block.end + +${TM_CURRENT_LINE/^\\s*((?:\\/\\/[\\/!]?|#|%|--|::|(?i:rem)|'|;)\\s*).*/$1/} +# ^ meta.group.regexp meta.group.regexp meta.literal.regexp +# ^ keyword.other.regex.mid.snippet + ]]>snippet< #^^^ meta.tag.cdata punctuation.definition.tag.end # ^^^^^^^ source.sublime.snippet