Permalink
Browse files

Fix paste bug where trailing newlines required a manual backspace.

  • Loading branch information...
1 parent a067dcc commit 92971904bc9fd2b988d8c16e9502edc39a70ff25 @fperez fperez committed Sep 7, 2010
Showing with 3 additions and 1 deletion.
  1. +3 −1 IPython/frontend/qt/console/console_widget.py
@@ -419,7 +419,9 @@ def paste(self, mode=QtGui.QClipboard.Clipboard):
"""
if self._control.textInteractionFlags() & QtCore.Qt.TextEditable:
try:
- text = str(QtGui.QApplication.clipboard().text(mode))
+ # Remove any trailing newline, which confuses the GUI and
+ # forces the user to backspace.
+ text = str(QtGui.QApplication.clipboard().text(mode)).rstrip()
except UnicodeEncodeError:
pass
else:

0 comments on commit 9297190

Please sign in to comment.