Skip to content

Commit f77bdd6

Browse files
committed
TMPrefs: Fix 'source' scope extending too far
Fixes #262.
1 parent eb8fcda commit f77bdd6

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

Package/TextMate Preferences/TextMate Preferences.sublime-syntax

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -321,16 +321,18 @@ contexts:
321321
scope: punctuation.definition.substitute-what.tmPreferences
322322
push:
323323
- meta_content_scope: source.regexp.oniguruma
324-
- match: '/'
325-
scope: punctuation.definition.substitute-with.tmPreferences
324+
- match: (?=/)
326325
set:
327-
- match: '(/)([gimsx-]*)(;|$)'
328-
captures:
329-
1: punctuation.definition.substitute-flags.tmPreferences
330-
2: storage.modifier.mode.regexp.transformation.tmPreferences
331-
3: punctuation.definition.substitution.end.tmPreferences
332-
pop: true
333-
- include: scope:source.regexp-replacement
326+
- match: '/'
327+
scope: punctuation.definition.substitute-with.tmPreferences
328+
set:
329+
- match: '(/)([gimsx-]*)(;|$)'
330+
captures:
331+
1: punctuation.definition.substitute-flags.tmPreferences
332+
2: storage.modifier.mode.regexp.transformation.tmPreferences
333+
3: punctuation.definition.substitution.end.tmPreferences
334+
pop: true
335+
- include: scope:source.regexp-replacement
334336
- include: Oniguruma RegExp.sublime-syntax#base-literal
335337
- include: Oniguruma RegExp.sublime-syntax#group-comment
336338
- include: Oniguruma RegExp.sublime-syntax#extended-patterns

Package/TextMate Preferences/syntax_test_tmPreferences.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@
205205
s/(\[[^\]]*\])|\b_\b\s*|\(.*|(\s{2,})/$1(?2 )/g; (?# this is a regex transformation
206206
<!-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.regex.transformation.tmPreferences source.regexp.oniguruma -->
207207
<!-- ^^ meta.inside-plist.plist meta.inside-dict.plist meta.inside-value.string.plist meta.regex.transformation.tmPreferences punctuation.definition.substitute-what.tmPreferences -->
208-
<!-- ^ punctuation.definition.substitute-with.tmPreferences -->
208+
<!-- ^ punctuation.definition.substitute-with.tmPreferences - source -->
209209
<!-- ^^ keyword.other.backref-and-recursion.conditional.regexp-replacement -->
210210
<!-- ^ punctuation.definition.substitute-flags.tmPreferences -->
211211
<!-- ^ storage.modifier.mode.regexp.transformation.tmPreferences -->

0 commit comments

Comments
 (0)