Indentation and code highlighting on multiline, quoted SQL queries
bfavaretto opened this issue · 1 comments
bfavaretto commented
When I create a multiline string with an SQL query, and the string begins with a line break, I lose the code highlighting (apparently, sql-string-double-quoted is not matching).
Also, whenever I add a new line break inside the string, Textmate is increasing the indentation level. So , when I try to write something like this:
$qry = "
SELECT col
FROM tbl
WHERE othercol = :val
";
I end up with this:
$qry = "
SELECT col
FROM tbl
WHERE othercol = :val
";
I posted a question on Stack Overflow about this, here is the link for reference: http://stackoverflow.com/questions/12452333/textmate-php-bundle-adds-extra-indentation-on-multiline-strings-how-to-avoid-it
nobios commented
This doesn't solve all problems. If I have a function call in one of the lines the indentation breaks.
if ($test) {
$qry = "SELECT
col as col,
DATE_FORMAT(col2)
FROM tbl
WHERE othercol = val";
}Becomes
if ($test) {
$qry = "SELECT
col as col,
DATE_FORMAT(col2)
FROM tbl
WHERE othercol = val";
}