Skip to content

Commit

Permalink
reinserted lines to handle comments and PEP8
Browse files Browse the repository at this point in the history
  • Loading branch information
pwoosam committed Dec 14, 2016
1 parent 34050c9 commit b902469
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions spyder/widgets/sourcecode/codeeditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1921,14 +1921,17 @@ def fix_indent(self, forward=True, comment_or_string=False):
cursor.movePosition(QTextCursor.PreviousBlock)
prevtext = to_text_string(cursor.block().text()).rstrip()

if prevtext:
if ((self.is_python_like()
and not prevtext.strip().startswith('#')
and prevtext)
or prevtext):

if (prevtext.strip().endswith(')') or
prevtext.strip().endswith(']') or
prevtext.strip().endswith('}')):

comment_or_string = True # prevent further parsing

elif prevtext.strip().endswith(':') and self.is_python_like():
add_indent = True
comment_or_string = True
Expand Down

0 comments on commit b902469

Please sign in to comment.