Skip to content

not able to define complex "color_scope" #9

Description

@MattDMo

Hi Scott,
I was going back over some old questions of mine, and found this answer of yours about underlining in Sublime. I used the settings you suggested (slightly modified to add true and false, and they worked, except the words were highlighted everywhere, including comments, strings, etc.:

persistentregexhighlight

So, I changed the "regex" to the following:

"regex": [{
    //"pattern": "(True|true|False|false)",
    "pattern_scope": "constant.language -comment -string",
    "color_scope": "constant.language",
    "underline": true
}],

but no luck - ([Tt]rue|[Ff]alse) still get underlined everywhere. I'd only like them to be underlined where the word itself actually appears in red. Is that doable? sublime.View.scope_name() should be useful, or you could try to parse a full "pattern_scope" string.

No big rush on this, just wondering if it can be done.

Thanks!
Matt

BTW, this is using version 2.0.2 on XP. I haven't tried any other platforms, or ST3, but there's no reason to think it would be different, is there?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions