Skip whitespace at the beginning of a failing query for the indication

For the error indicators and scrolling to the failing query, all the
whitespace present at the starting end of the query is skipped. Otherwise
the point indicated to the user could be very far to the actual query.

See issue #2073
This commit is contained in:
mgrojo
2019-12-30 20:29:44 +01:00
parent a287d8a27b
commit 81ee07355d

View File

@@ -1087,6 +1087,9 @@ void MainWindow::executeQuery()
// Note that execute_from_index uses character positions and not byte positions, so text().length() must be used.
if (editor->text(execute_from_line).length() == execute_from_index+1) {
execute_from_line++;
// The next lines could be empty, so skip all of them too.
while(editor->text(execute_from_line).trimmed().isEmpty())
execute_from_line++;
execute_from_index = 0;
}