Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

highlight multiple keyword with bracket ? [" ", " "] #36

Closed
jonlepage opened this issue May 14, 2017 · 6 comments
Closed

highlight multiple keyword with bracket ? [" ", " "] #36

jonlepage opened this issue May 14, 2017 · 6 comments

Comments

@jonlepage
Copy link

Hi its possible to add bracket to set multiple highlight groupe ?
I have a lot of keyword to put up with some color.
Would be great if you can add this feature?

ex:
{ "text": [".quad:",".cubic:",".quart:",".quint:",".sine:",".exp:",".bounce:"], "color": "#000" }

@wayou wayou closed this as completed in 82813b1 May 17, 2017
@wayou
Copy link
Owner

wayou commented May 17, 2017

hi, install the newest version and try todohighlight.keywordsPattern. For the style config the todohighlight.defaultStyle

@jonlepage
Copy link
Author

I'm not able to set the style for the patern?
example this is 2 set of keyword i need to custom color and background.
You have a functional example.
Great update thanks.

"todohighlight.keywordsPattern": { "text": ".quad|.cubic|.quart|.quint", "color": "#f68500", "backgroundColor": "rgba(0, 0, 0, 0.4)" }, { "text": ".out|.in|.inout", "color": "#ce2d2d", "backgroundColor": "#110c04" }

@jonlepage
Copy link
Author

or i try like that but not work !

   "todohighlight.keywords": [
        {
            "text": ".quad|.cubic|.quart|.quint",
            "color": "#f68500",
            "backgroundColor": "rgba(0, 0, 0, 0.4)"
        },        {
            "text": ".out|.in|.inout",
            "color": "#ce2d2d",
            "backgroundColor": "#110c04"
        }

@wayou
Copy link
Owner

wayou commented May 17, 2017

Noop, you can not using the regexp with keywords configuration but keywordsPattern.
The new version doesn't implement exactly what you mean, just supported the ability to using regexp via todohight.keyeordsPattern.

@jonlepage
Copy link
Author

ok yes i understand.
Ex; this work

"todohighlight.keywordsPattern": "quad|cubic|quart|quint",
but if i need to set the color and style of this
i use your plugin to set some color keyword , to help me to visual found easy proprety of my project
afvav
note , i think the '' or DOT . not work since update.

ex: "text": " 'mykeyword' " or "text": " .mykeyword "
"todohighlight.keywords": [
{
"text": " 'mykeyword' ",
"color": "#f68500",
"backgroundColor": "rgba(0, 0, 0, 0.4)"
}

@wayou
Copy link
Owner

wayou commented May 18, 2017

tried on my side and these are all work:

"todohighlight.keywords": [
        "NOTE:",
        "BUG:",
        "OPTIMIZE:",
        "REVIEW:",
        "DEBUG:",
        {
            "text": "'foo'"
        },{
            "text": ".bar"
        },{
            "text": ".quz"
        }
    ],

however, I found `foo` this won't be highlighted.
so what need to be fixed is the backtick.

wayou added a commit that referenced this issue May 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants