Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix paste bug where trailing newlines required a manual backspace.

  • Loading branch information...
commit 92971904bc9fd2b988d8c16e9502edc39a70ff25 1 parent a067dcc
Fernando Perez fperez authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 IPython/frontend/qt/console/console_widget.py
4 IPython/frontend/qt/console/console_widget.py
View
@@ -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:
Please sign in to comment.
Something went wrong with that request. Please try again.