From 188f797c378c0ee6f5b578fa63e1aa0348800ecf Mon Sep 17 00:00:00 2001 From: thatsIch Date: Sun, 22 Jan 2017 19:42:38 +0100 Subject: [PATCH] Fixed #31: Highlight include correctly in [Variables] --- Rainmeter.sublime-syntax | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/Rainmeter.sublime-syntax b/Rainmeter.sublime-syntax index dbe3e16..a506393 100644 --- a/Rainmeter.sublime-syntax +++ b/Rainmeter.sublime-syntax @@ -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 @@ -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