Skip to content

Commit b1e14bd

Browse files
committed
Fix string termination inside var function
Also need to adjust scope for var completions.
1 parent 9a76262 commit b1e14bd

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

Package/Sublime Text Color Scheme/Sublime Text Color Scheme.sublime-syntax

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,10 @@ contexts:
336336
pop: true
337337
- match: \w+
338338
scope: variable.other.color-scheme
339-
339+
- match: (?=") # embed this here so we don't have to "with_prototype"
340+
pop: true
341+
- match: (?=")
342+
pop: true
340343
color-list-pop:
341344
- match: \[
342345
scope: meta.foreground.color-list.sublime-color-scheme punctuation.section.sequence.begin.json

Package/Sublime Text Color Scheme/syntax_test_colorscheme.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
"stack_guide": "#9D550FB0",
5050
"shadow_width": "12",
5151
"shadow": "#cccccc",
52+
"caret": "var(unclosed_var",
53+
// ^^^^^^^^^^^^ variable.other.color-scheme
54+
// ^ punctuation.definition.string.end.json
5255
"invisibles": "#F8F8F239",
5356
"bracket_options": "squiggly_underline stippled_underline",
5457
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.json meta.underline-style.sublime-color-scheme string.quoted.double.json

plugins_/color_scheme_dev.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ def verify_scope(selector, offset=0):
7272
return all(self.view.match_selector(point + offset, selector)
7373
for point in locations)
7474

75-
if verify_scope("meta.function-call.var.sublime-color-scheme"):
75+
if (
76+
verify_scope("meta.function-call.var.sublime-color-scheme")
77+
or (verify_scope("meta.function-call.var.sublime-color-scheme", -1)
78+
and verify_scope("punctuation.definition.string.end.json"))
79+
):
7680
return self.variable_completions(prefix, locations)
7781

7882
elif verify_scope("meta.scope-selector.sublime"):

0 commit comments

Comments
 (0)