How else is it supposed to detect the string contains SQL and highlight it? Through my usage I’ve noticed any string which matches /^(SELECT|INSERT|UPDATE|DELETE|REPLACE)\s/ will be considered as SQL and highlighted accordingly.
I Presume you mean something like this:
$sql = "SELECT * FROM table WHERE hello='".$world."' AND foo='bar' ORDER BY something ASC";
On my install (Windows 7 x64), verything befor $world is highlighted as SQL, everything after is not.
I don’t think this is a bug as such. The way I see it it’s not highlighting the second half of the SQL because ST2 doesn’t have a deep understanding of PHP, so it isn’t aware you’re concatenating two strings, it just sees two separate strings separated by .$world. (Based on my observations, someone correct me if I’m wrong).
A way round this is to use double quotes for the SQL string and {} to place your variables within it. For Example:
$sql = "SELECT * FROM table WHERE hello='{$world}' AND foo='bar' ORDER BY something ASC";
The whole string is highlighted as you’d expect (or at least how I expect ).
Hope that helps.