Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing code style suggestions from Carriage Return fix PR #618

Merged
merged 2 commits into from
Aug 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions qtconsole/console_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,15 +1017,15 @@ def _append_custom(self, insert, input, before_prompt=False, *args, **kwargs):
and self._append_before_prompt_pos != self._get_end_pos():
cursor.setPosition(self._append_before_prompt_pos)

# If we appending on the same line as the prompt, use insert mode
# If we're appending on the same line as the prompt, use insert mode
dalthviz marked this conversation as resolved.
Show resolved Hide resolved
# If so, the character at self._append_before_prompt_pos will not be a newline
cursor.movePosition(QtGui.QTextCursor.Right,
QtGui.QTextCursor.KeepAnchor)
if cursor.selection().toPlainText() != '\n':
cursor._insert_mode = True
cursor.movePosition(QtGui.QTextCursor.Left)
else:
# Insert at current printing point
# Insert at current printing point.
# If cursor is before prompt jump to end, but only if there
# is a prompt (before_prompt_pos != end)
if cursor.position() <= self._append_before_prompt_pos \
Expand Down Expand Up @@ -1694,9 +1694,12 @@ def _on_flush_pending_stream_timer(self):
self._flush_pending_stream()

def _flush_pending_stream(self):
""" Flush pending text into the widget. Only applies to text that is pending
when the console is in the running state. Text printed when console is
not running is shown immediately, and does not wait to be flushed.
"""
Flush pending text into the widget.

Only applies to text that is pending when the console is in the
dalthviz marked this conversation as resolved.
Show resolved Hide resolved
running state. Text printed when console is not running is shown
immediately, and does not wait to be flushed.
"""
text = self._pending_insert_text
self._pending_insert_text = []
Expand Down
Loading