summaryrefslogtreecommitdiff
path: root/sqlparse
diff options
context:
space:
mode:
Diffstat (limited to 'sqlparse')
-rw-r--r--sqlparse/filters.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/sqlparse/filters.py b/sqlparse/filters.py
index bf65a4a..4a0b2c7 100644
--- a/sqlparse/filters.py
+++ b/sqlparse/filters.py
@@ -379,7 +379,12 @@ class ReindentFilter:
identifiers = list(tlist.get_identifiers())
if len(identifiers) > 1 and not tlist.within(sql.Function):
first = list(identifiers[0].flatten())[0]
- num_offset = self._get_offset(first) - len(first.value)
+ if self.char == '\t':
+ # when using tabs we don't count the actual word length
+ # in spaces.
+ num_offset = 1
+ else:
+ num_offset = self._get_offset(first) - len(first.value)
self.offset += num_offset
for token in identifiers[1:]:
tlist.insert_before(token, self.nl())