Indentation inside SQL queries
OlofT opened this issue · 1 comments
When writing a query, indentation is altered in unexpected manners when editing the last line having the quotation after the insertion point. Like this, the blinking marker is shown with a |
$query = sprintf("SELECT id
FROM a_table
WHERE some_value = 2
|");
Now if I start typing it will move one indent to the left resulting in:
$query = sprintf("SELECT id
FROM a_table
WHERE some_value = 2
AND some_other_value = 1");
This is of-course not the end of the world, but the underlying bug that causes this issue might stir up problems in other places as well.
Now we get the following errors instead, the blinking marker is again shown with a |
Inside the string we get a single indent (which might be ok, but slightly annoying):
$query = sprintf("SELECT id
|
You have to manually indent the string to the right level, but it will go back again on the next line:
$query = sprintf("SELECT id
FROM a_table
|
And so on for each line, until we close the string and the indent goes up to the string's indent level:
$query = sprintf("SELECT id
FROM a_table
WHERE some_value = 2
AND some_other_value = 1");
|
Now it is really hard to get back to the original indent level, since the caret will always move up to line with the string. The only way to get back to the right indent level is to type some text, highlight the added indents and delete them.