Skip to content

Commit

Permalink
fix behavior to \n
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbautista committed Sep 2, 2024
1 parent 6aa21d6 commit 46aa854
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion qtconsole/ansi_code_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def split_string(self, string):
# strings ending with \r are assumed to be ending in \r\n since
# \n is appended to output strings automatically. Accounting
# for that, here.
last_char = '\n' if len(string) > 0 and string[-1] == '\n' else None
last_char = None#'\n' if len(string) > 0 and string[-1] == '\n' else None
string = string[:-1] if last_char is not None else string

for match in ANSI_OR_SPECIAL_PATTERN.finditer(string):
Expand Down
3 changes: 2 additions & 1 deletion qtconsole/console_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -2221,7 +2221,8 @@ def _insert_plain_text(self, cursor, text, flush=False):

elif act.action == 'newline':
if not cursor.movePosition(QtGui.QTextCursor.NextBlock):
cursor.movePosition(QtGui.QTextCursor.EndOfLine)
cursor.movePosition(QtGui.QTextCursor.EndOfLine,
QtGui.QTextCursor.MoveAnchor)
cursor.insertText('\n')

# simulate replacement mode
Expand Down

0 comments on commit 46aa854

Please sign in to comment.