Bug #66382 Tabs and Spaces in Query Editor
Submitted: 14 Aug 2012 16:35 Modified: 28 Aug 2014 0:53
Reporter: Anil Natha Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S4 (Feature request)
Version:5.2.42 OS:MacOS
Assigned to: CPU Architecture:Any
Tags: copy and paste, query, spaces, tabs, whitespace

[14 Aug 2012 16:35] Anil Natha
Description:
The Query Tabs lack the ability to make use of tabs instead of spaces to properly format queries.  This makes it challenging at times when writing queries or simply copy and pasting queries in the query tab.  I wish that we could choose in the application preferences to use tabs instead of spaces and also set the tab size (ie. number of spaces) so that query formatting is preserved.

How to repeat:
Nothing to describe as this is a feature request.
[14 Aug 2012 20:39] Rafael Antonio Bedoy Torres
Hello Anil,
Can you please explain a bit more about the "lack the ability to make use of tabs", I can use the tab key with no problems on the SQL Editor.

Thanks in advance!
[15 Aug 2012 16:32] Anil Natha
Hi Rafael,

To clarify what I was recommending, it's that I wish that when you hit the tab key, it enters a tab character into the query editor, not three spaces.  This is important because many developers use tabs characters instead of spaces to indent their code.  And if you copy and paste queries to and from the query editor tab, it alters the formatting of your code.  This forces the developer to then have to go back and replace spaces with tabs.

In addition, nearly every programming IDE also allows the developer to choose the number of spaces a tab character should represent.  For example, some developers use 3 spaces, some use 4.  This keeps your code formatted the same regardless of which computer you open on so long as your tab size is the same between computers.

I hope that this better described what I was referring to. If not, let me know and I would be happy to describe it further.
[15 Aug 2012 17:06] Anil Natha
HI Rafael,

I just checked again and you are correct, tab characters are now part of WB.  I am so sorry.  I hadn't noticed that it was added recently and hadn't checked if this was still the case in version 5.2.42.

Although now you can enter tab characters, I still do not see a place where the developer can choose how many spaces each tab character can represent.

Thanks again.
[15 Aug 2012 19:59] Rafael Antonio Bedoy Torres
Valid Enhancement.
[28 Aug 2014 0:53] Philip Olson
Fixed as of the upcoming MySQL Workbench 6.2.2 release, and here's the changelog entry:

The tab key now inserts a tab character into the query editor, when before
it inserted three spaces.

Thank you for the bug report.