du-song / SublimeFormatSQL

Sublime Text 2 command to format long SQL statement to a more readable form (also available via Package Control)
Other
112 stars 43 forks source link

Proposed fix for convert to tabs #6

Open jandor64 opened 11 years ago

jandor64 commented 11 years ago

Hi, due to my unfamiliarity with git I'm not making a proper pull request.

However, I've added these lines to handle converting to tabs, beginning on line 30 of FormatSQL.py

default_formatted = sqlparse.format(s, keyword_case="upper", reindent=True, indent_width=indent_size)
if settings.get("translate_tabs_to_spaces"):
    return default_formatted
else:
    tab_formatted = default_formatted.replace('    ',"\t")
    return tab_formatted

This is working for me, sublime text 2.0.1, windows 7, tabs on.