Permalink
Browse files

Add a new line before displaying multiline strings in the Qt console.

Closes gh-510
  • Loading branch information...
1 parent b7839fa commit 4066b4225de39f144d22f89e23b7837096cd4d55 @takluyver committed Jun 10, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 IPython/frontend/qt/console/ipython_widget.py
@@ -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):

0 comments on commit 4066b42

Please sign in to comment.