Skip to Main Content

SQL Developer

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Bug or feature? Converting tab to spaces in text literals while typing in the editor

mathguyFeb 24 2021 — edited Feb 24 2021

Is this a bug, or just an annoyance? Something that could be addressed? Or just something I am misunderstanding or I am doing wrong?
Here is the issue. SQL Developer 18.1.0.095 on top of Oracle Linux Server 7.9

When I type "at the console" (meaning, on my keyboard) in the SQL Developer editor, tabs are converted to two spaces (my choice). That makes perfect sense in code, but it shouldn't be allowed to happen in data (meaning: while I am typing a hard-coded string literal in single quotes, for example).
I can't prove what I am doing, so you will need to trust me. While I am typing the SELECT statement below, in the string I type the letter a, then a TAB, and then the letter b. But look at what DUMP() reports:

select dump('a b') as result from dual;   -- I typed TAB between a and b

RESULT              
-------------------------
Typ=96 Len=4: 97,32,32,98           --  32 = SPACE (two of them)

So, it's not just that the editor renders a tab as two spaces - it actually changes the text itself. And if it did that in the code, it would be no problem - but it shouldn't be allowed to change the data I type on my keyboard.
(Now, I don't know much about computing in general, and "intellisense" type features in particular; but in my narrow mind, code of any kind should preserve tabs wherever they are typed, and the GUI should only display tabs on screen as so-many-spaces. If in fact tabs are hard-replaced with spaces, OK, but that shouldn't happen in data - in text literals.)

Note that this only happens when I type the command at the keyboard. If I type the same string (with a tab) in a different application, then I copy it and paste it in the SQL Developer editor, the tab is not converted to spaces. In the example below, I typed the string in Text Editor (standard application on Oracle Linux) and pasted in SQL Developer:

select dump('a   b') as result from dual;

RESULT              
---------------------
Typ=96 Len=3: 97,9,98                       -- 9 = TAB

If you wonder, "your strings should be stored in tables, when do you ever care about typing hard-coded strings at the console?" - there are many cases; a simple one is while I am typing a regular expression and I must type a tab as part of the regexp. Or if I am writing a WHERE clause comparing to a string with tabs. Etc.
I know there are workarounds, but that is not the question.
Thoughts? Thank you, - mathguy

This post has been answered by Vadim Tropashko-Oracle on Feb 26 2021
Jump to Answer
Comments
Post Details
Added on Feb 24 2021
6 comments
1,019 views