Skip to content
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

bug with "indent_tabs": true #8

Open
pedrogazzola opened this issue Jan 28, 2015 · 1 comment
Open

bug with "indent_tabs": true #8

pedrogazzola opened this issue Jan 28, 2015 · 1 comment

Comments

@pedrogazzola
Copy link

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.

@eleftrik
Copy link

eleftrik commented Oct 2, 2015

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants