Skip to content

Commit

Permalink
Snippet: Fix highlighting of forward slashes in regex
Browse files Browse the repository at this point in the history
Fixes #241.
  • Loading branch information
FichteFoll committed Mar 18, 2019
1 parent 50840c7 commit 5f563f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions Package/Sublime Text Snippet/syntax_test_snippet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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<</content>
#^^^ meta.tag.cdata punctuation.definition.tag.end
# ^^^^^^^ source.sublime.snippet
Expand Down

0 comments on commit 5f563f6

Please sign in to comment.