Closed bojidar-bg closed 9 years ago
Ok, but, plz, dont break support of String.match and basic "plain" rules. For "projectPath" i suggest implement coffeescript templating: "#{projectPath}"
I think that it won't affect basic (regex) rules, because it will just concatenate strings.. And currently regexes are represented as Strings (see this stackoverflow question for details), so it shouldn't be a problem.
And about the templating, I like the idea, though it need a separate issue :smile:... actually I meant some project path, cus I don't want to color the tabs of all my projects..
@averrin And again, thank you for making this great package :+1:¹⁰⁰
@averrin Ok, I made the PR :smiley:
Now... I guess it's time for a new tag? :smile:
Im not very good in coffeescript too, but after some magic it works=) Need some more documentation in README (pr is welcome=))) ) and i will publish it
@averrin Ok, maybe a bit later I can make some docs for the new feature :smile:
@bojidar-bg sorry, i missed, that you are update readme already.
published
@averrin ~ Well, can you surround that sample code in ``` instead of
? (so it will be multiline)
I did it before publishing=)
LOL, didn't notice it ... xD
Nice.. I found a bug :smile: I can't have more than two levels of rules, e.g.
"**/Projects/":
"nodejs/":
"**/package.json": "red" # This won't ever make a match...
"someProject/**/*.js": "green"
I think that if line 69 https://github.com/averrin/color-tabs-regex/blob/master/lib/color-tabs-regex.coffee#L69 is changed to
output = @expandRules(rules[rule], prefix + rule, output)
^^^^^^^^^ <- Added
this bug will not happen :smile:.
Sorry for sending such buggy code to you...
You repoened it just in order to close it? o.O
I confirmed this bug, and fix it.=)
=)
Currently my CSON file looks like:
It will be much cleaner if it was like:
The easiest way to implement this I can think of is to concatenate the strings of the "parent" rule and the "child" rule.
(Note that rule inside rules inside rules inside rules should also be supported)
P.S. if you aren't as fast as the last time, I might make a PR :smiley: