SqlBeautifier icon indicating copy to clipboard operation
SqlBeautifier copied to clipboard

bug with "indent_tabs": true

Open pedrogazzola opened this issue 10 years ago • 1 comments

Using these settings: { "indent_tabs": true, "indent_width": 1, "reindent": true }

The SQL code gets this nice format:

SELECT foo,
       bar AS BAR
FROM TABLE
WHERE stuff = stuff2
 AND other_stuff NOT IN ('TH',
                         'AN',
                         'KS')
 AND blah = bleh

But I want to use tabs instead of spaces, so now with plugin settings: { "indent_tabs": true, "indent_width": 1, "reindent": true }

The code gets formatted to (had to use an image): example

I guess the problem is that the number of tabs used is the same number of the calculated spaces, is there any way to read the user's customized tab size to do the math? Congratulations for the great plugin.

pedrogazzola avatar Jan 28 '15 16:01 pedrogazzola

@pedrogazzola , I have the same issue. With these settings:

{"indent_tabs": false, "indent_width": 4}

code gets by a wrong number of spaces.

Example:

select f.id, f.name, b.login
from foo f,bar b
where 1=1 and f.id=b.id;

...becomes (dots=spaces)

select f.id,
.......f.name,
.......b.login
from foo f,
.....bar b
where 1=1
....and f.id=b.id;

Did you solve somehow? Thanks.

eleftrik avatar Oct 02 '15 07:10 eleftrik