New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
auto indent not working on new line after semicolon #2768
Comments
It seems it was a deliberate feature added in aedd8cd. Any chance in getting a config option to turn this on/off? |
Yes, this probably should be configurable. |
Or, better, we shouldn't reset indentation but we should do single "unindent" after semicolon. This makes sense for complicated query/procedures with multiple indentations. |
Current behaviour is somewhat strange (or too simple) when editing PL/pgSQL: DO $$
DECLARE
a text[] := array['foo', 'bar'];
t text;
BEGIN
FOREACH t IN ARRAY a
LOOP
RAISE NOTICE '%', t;
END LOOP;
END $$; Instead of keeping the indentation of the previous line, the next line after pressing enter after a line ending with a semicolon starts one column too far to the left. |
It looks like that when a delimiter is detected at the end of the line where users starts the new line, the SQLIndenter always unindents the new line by 1 "column". It doesn't check whether the columns are build up by spaces or tabs. So the following script will incorrectly unindent when adding a new line.
When the line didn't end with a delimiter the SQLInderter will not unindent by 1 column. The unindenting is caused by the following line. |
#2768 Removed auto unindent on new line after delimiter.
I'm using DBeaver CE 4.3.2 on Ubuntu 16.04 and have noticed since 4.3.1 that when I start a new line in Oracle PL/SQL code the autoindent as in 4.2.x is only replicated when the previous line was not ended with a semicolon (';'). If the previous line was ended with a semicolon, the new line will start at column 1, not the at the previous indentation level.
There's no autoindent option in the GUI that I can find under preferences so I'm inclined to think this is a regression on previous behaviour
The text was updated successfully, but these errors were encountered: