Skip to content

Commit

Permalink
Fixed #31: Highlight include correctly in [Variables]
Browse files Browse the repository at this point in the history
  • Loading branch information
thatsIch committed Jan 22, 2017
1 parent 9ec977f commit 188f797
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions Rainmeter.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,16 @@ contexts:
- match: "^\\s*;.*$"
captures:
0: comment.line.character.rainmeter

- include: color-definition
- include: bangs
- include: all-variables
- include: includes

# All other options in a section
- match: "(?i)^\\s*(?!@include([^=])*)([^\\s=]+)\\s*(=)"
captures:
2: storage.type.variable.rainmeter
3: keyword.operator.option.equal.rainmeter
- include: variable-section-variables

# next section
- match: "^(?=\\s*\\[)"
pop: true

Expand Down Expand Up @@ -639,6 +641,23 @@ contexts:
scope: support.function.bang.rainmeter


# Include statements
includes:
- match: "(?i)\\s*(@include([^=])*)\\s*(=)"
scope: meta.option.predefined.include.rainmeter
captures:
1: storage.type.option.predefined.include.rainmeter
3: keyword.operator.option.equal.rainmeter


# negative lookahead to negate having @include as a variable
variable-section-variables:
- match: "(?i)^\\s*(?!@include([^=])*)([^\\s=]+)\\s*(=)"
captures:
2: storage.type.variable.rainmeter
3: keyword.operator.option.equal.rainmeter


meter-shape-modifier:
# - meta_scope: source.rainmeter

Expand Down

0 comments on commit 188f797

Please sign in to comment.