Skip to content

Commit

Permalink
minification.py: Fixed the bug reported in issue #34 where multiple d…
Browse files Browse the repository at this point in the history
…ecorators on the same function were not being indented properly.
  • Loading branch information
liftoff committed Feb 6, 2015
1 parent 63240c3 commit 92bdf14
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyminifier/minification.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ def foo(foo,bar,blah):
# mixed strings using both single quotes and double quotes.
out += "'''" + new_string + "'''"
joining_strings = False
if token_string == '@': # Decorators need special handling
if prev_tok[0] == tokenize.NEWLINE:
# Ensure it gets indented properly
out += (" " * (start_col - last_col))
if not joining_strings:
out += token_string
last_col = end_col
Expand Down

0 comments on commit 92bdf14

Please sign in to comment.