Skip to content

Commit

Permalink
fixTests
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbautista committed Sep 2, 2024
1 parent 9189023 commit 7591edd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion qtconsole/console_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -2220,7 +2220,10 @@ def _insert_plain_text(self, cursor, text, flush=False):
QtGui.QTextCursor.MoveAnchor)

elif act.action == 'newline':
if not cursor.movePosition(QtGui.QTextCursor.NextBlock):
self.log.debug(self._prompt)
if cursor.block() != cursor.document().lastBlock():
cursor.movePosition(QtGui.QTextCursor.NextBlock)
else:
cursor.movePosition(QtGui.QTextCursor.EndOfLine,
QtGui.QTextCursor.MoveAnchor)
cursor.insertText('\n')
Expand Down
2 changes: 1 addition & 1 deletion qtconsole/tests/test_00_console_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ def test_print_carriage_return(self):

for text in test_inputs:
w._append_plain_text(text, before_prompt=True)
#w._flush_pending_stream() # emulate text being flushed
w._flush_pending_stream() # emulate text being flushed

self.assert_text_equal(w._get_cursor(),
"Hello\u20290123456789\u2029\u2029prompt>")
Expand Down

0 comments on commit 7591edd

Please sign in to comment.