diff --git a/qtconsole/ansi_code_processor.py b/qtconsole/ansi_code_processor.py index 3875c23d..16f2ddde 100644 --- a/qtconsole/ansi_code_processor.py +++ b/qtconsole/ansi_code_processor.py @@ -182,15 +182,17 @@ def set_csi_code(self, command, params=[]): count = params[0] if params else 1 self.actions.append(ScrollAction('scroll', dir, 'line', count)) - elif (command == 'A'): # Move N lines Up + elif command == 'A': # Move N lines Up dir = 'up' count = params[0] if params else 1 self.actions.append(MoveAction('move', dir, 'line', count)) - elif (command == 'B'): # Move N lines Down + + elif command == 'B': # Move N lines Down dir = 'down' count = params[0] if params else 1 self.actions.append(MoveAction('move', dir, 'line', count)) - elif (command == 'F'): # Goes back to the begining of the n-th previous line + + elif command == 'F': # Goes back to the begining of the n-th previous line dir = 'leftup' count = params[0] if params else 1 self.actions.append(MoveAction('move', dir, 'line', count)) diff --git a/qtconsole/console_widget.py b/qtconsole/console_widget.py index 495b3409..aa492baf 100644 --- a/qtconsole/console_widget.py +++ b/qtconsole/console_widget.py @@ -2192,18 +2192,22 @@ def _insert_plain_text(self, cursor, text, flush=False): if act.dir == 'up': for i in range(act.count): cursor.movePosition( - QtGui.QTextCursor.Up) + QtGui.QTextCursor.Up + ) elif act.dir == 'down': for i in range(act.count): cursor.movePosition( - QtGui.QTextCursor.Down) + QtGui.QTextCursor.Down + ) elif act.dir == 'leftup': for i in range(act.count): cursor.movePosition( - QtGui.QTextCursor.Up) + QtGui.QTextCursor.Up + ) cursor.movePosition( - QtGui.QTextCursor.StartOfLine, - QtGui.QTextCursor.MoveAnchor) + QtGui.QTextCursor.StartOfLine, + QtGui.QTextCursor.MoveAnchor + ) elif act.action == 'carriage-return': cursor.movePosition(