Skip to content

Commit

Permalink
Merge branch 'TQDMQtConsole' of https://github.com/jsbautista/qtconsole
Browse files Browse the repository at this point in the history
… into TQDMQtConsole
  • Loading branch information
jsbautista committed Oct 17, 2024
2 parents a7b4c10 + ddf5a1d commit c7b4589
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
8 changes: 5 additions & 3 deletions qtconsole/ansi_code_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
14 changes: 9 additions & 5 deletions qtconsole/console_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit c7b4589

Please sign in to comment.