Follow up to
http://forum.lazarus.freepascal.org/index.php/topic,27985.msg173857.html#msg173857Yes you are right, I did not check before I posted.
The base colors do not have a priority.
You can add a feature request, but it will be awhile before I get to it.
It doesn't have to be a feature request. The syntax highlighting engine would only need to switch into string mode once it encounters an opening quote (as it does for the color), disabling any keyword checking until the closing quote.
Well even this kind of "disabling" would need to bi implemented. So it is a feature request.
But it is not at all that easy.
The markup, and the highlight are done in 2 independent modules. That is because the markup works with any highlighter, and even without highlighter.
The markup would need to enquire with the highlighter (if any highlighter is used), what token type is present at a certain location. Strings can start with different chars in different languages. In some languages string may be multi line)
And (example for pascal) this would include handling search terms like
:= 'abc
which are part string (so it is not enough to check at the begin of the token)
In the IDE the search engine does not provide reg ex for this, but some of the related classes can be used with reg-ex. So matching part string would not always be that obvious.
It also needs to detect, if text changes between string, and none string (multiline string / change of hl). Or (in pascal) with comments, that could be at any line in the text (string becomes comment and vice versa), since there are multi line comments.
The fact that strings can change over many lines, of which only the first was edited, means that the current concept of finding the correct range to rescan for matches must be changed too. IIRC Currently only edited lines are re-searched (if they are visible on the screen)
All in all, it is not a simple as it sounds.
I would probably first work on providing this via priorities (not hand to do, but I still need to find the time, there are other things I want to finish first).
Priorities will solve many cases.
Priorities do not have the issues with what needs to be searched. The found results do not change. priorities simply decide, at the time of actual painting the text to the canvas, if a color is applied or not.
Adding dedicated search in/outside string options would probably be much later.