averrin / color-tabs-regex

Use color-tabs package with regex.
https://atom.io/packages/color-tabs-regex
MIT License
8 stars 6 forks source link

Fix #5 - added child rules #6

Closed bojidar-bg closed 9 years ago

bojidar-bg commented 9 years ago

@averrin ~ Please test this PR, because I haven't. (except basic tests like testing the expandRules function and compiling the coffeescript)

The config CSON might now look like: (in this example I'm using String.match and break on first match)

".*?/Projects/ColorfulProject/":
  "models/":
    ".*?\\.js": "green"
    ".*?\\.sql": "blue"
  ".*?\\.js": "red"
  ".*?\\.html": "blue"
".*?/Projects/GrayProject/.*": "gray"

These will be converted to normal rules like this:

".*?/Projects/ColorfulProject/models/.*?\\.js": "green"
".*?/Projects/ColorfulProject/models/.*?\\.sql": "blue"
".*?/Projects/ColorfulProject/.*?\\.js": "red"
".*?/Projects/ColorfulProject/.*?\\.html": "blue"
".*?/Projects/GrayProject/.*": "gray"
bojidar-bg commented 9 years ago

Also, please note that this is my first time to write in coffeescript, so check the style :wink: