Skip to content

Commit

Permalink
Add a new line before displaying multiline strings in the Qt console.
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Jun 10, 2011
1 parent b7839fa commit 4066b42
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions IPython/frontend/qt/console/ipython_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ def _handle_pyout(self, msg):
self._append_plain_text(self.output_sep)
self._append_html(self._make_out_prompt(prompt_number))
text = data['text/plain']
# If the repr is multiline, make sure we start on a new line,
# so that its lines are aligned.
if "\n" in text and not self.output_sep.endswith("\n"):
self._append_plain_text('\n')
self._append_plain_text(text + self.output_sep2)

def _handle_display_data(self, msg):
Expand Down

0 comments on commit 4066b42

Please sign in to comment.