Indenting and Tabs

As a tab user I find the following settings work best:

[ ] Smart tab
[*] Smart fill
[*] Use tab character

However,
  • The Block Indent/Unindent feature ignores these settings and uses spaces regardless.
  • The editor (along with the PL/SQL Beautifier) makes no distinction between procedural block indents and SQL spacing, and blindly replaces every n leading spaces with a tab.
  • When editing in a SQL window you must therefore deselect the "Use Tab Character" option, then remember to put it back afterwards. In a Program window you just have to do everything manually with copy & paste (or configure Vim as your external editor, though this defeats many of PL/SQL Dev's other nice features).

Also, when you press Return at the end of an indented line, the editor creates a new indented line and places the cursor at the end of it (similarly to the autoindent feature in vi). However if you want to leave a blank line and so press Return again, it creates another indented line but does not clear up the first one (as vi does). This leaves a line containing only tabs/spaces which you must clear up manually.

Once tabs/spaces are messed up it's very hard to tell until it's too late, because there is no way to make tabs visible. It would be nice if you had the option to assign a colour to the tab character. (The alternative is to edit with Vim and search for \t, so that they all show up in yellow.)

The way I want to use tabs is described here: www.williamrobertson.net/plsqlstandards

Are there any improvements in this area planned for the next version? (I did notice a mention of indents in the post "tab converted to spaces", but not sure if this is this is the same issue.)
 
If I understand correctly you only want to use the "smart fill" option when indenting from the left margin?
 
That's correct.

Also to be really useful, the smart-filler would be aware of the column position of the start of the current SQL statement, and would switch to spaces-only after that position. That is, blocks would be indented from the left margin using tab characters, but additional spacing for SQL statements would be made up of spaces. For example,

Code:
[tab]SELECT col1
[tab]     , col1
[tab]FROM   sometable
[tab]     , anothertable
[tab]WHERE  etc
[tab]AND    col3 IN
[tab]       ( SELECT expr
[tab]         FROM   moretables );
What autoindenters generally give you instead is something like

Code:
[tab]SELECT col1
[tab][tab], col1
[tab]FROM   sometable
[tab][tab], anothertable
[tab]WHERE  etc
[tab]AND    col3 IN
[tab][tab]  ( SELECT expr
[tab][tab]    FROM   moretables );
which is not useful because the alignment is broken when viewed with a different tab size. No other editor can do this AFAIK - it would be awesome if PL/SQL Dev could be the first.
 
Back
Top