Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Indentation and code highlighting on multiline, quoted SQL queries #26

Closed
bfavaretto opened this Issue · 1 comment

3 participants

@bfavaretto

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

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";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.