Closed norcalli closed 4 years ago
I'm against the behavior you're describing because
I think you could have a lookup table that maps keywords to specific colors if someone comes up with an use-case for it. As I understand it currently, I'd just remove the behavior you're describing and wait for a real need to implement the thing I mentioned.
If you want to keep it, there should at least be a way to turn it off. It makes more sense to turn it off completely, then.
@resolritter I agree, and I'm actually working on a fix for that right now which I'll be pushing soon. If someone desires the old behaviour, they can ask for it and then I will add it as a configurable option. Prematurely adding features has already bitten me with this plugin by allowing each highlighter to be configurable, which greatly increased the complexity. On average, most people will probably just use css = true
rather than the individual options.
It's kind of hard to implement, though, because it requires looking ahead. Blueberry
is fine, but what about BlueGray
. Should that be two highlights for Blue
Gray
or not highlighted?
IMO only highlight if the whole word (or keyword if there are edge cases?) is a specific match, so only
\<non-word>Blue\<non-word>
would be highlighted.
Fair enough. I implemented it. I'll release it today.
The
Blue
inBlueberry
will be highlighted right now. This is a bug or a feature depending on the user. It's very easy to fix, but is it something that someone might want left in?