Skip to content

Commit

Permalink
fix #3712
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15729 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
borysiasty committed Apr 16, 2011
1 parent e7958d7 commit 9b4ed0c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,13 @@ def keyPressEvent(self, e):

def insertFromMimeData(self, source):
self.cursor = self.textCursor()
self.cursor.movePosition(QTextCursor.End, QTextCursor.MoveAnchor, 1)
self.setTextCursor(self.cursor)
if source.hasText():
pasteList = QStringList()
pasteList = source.text().split("\n")
# move the cursor to the end only if the text is multi-line or is going to be pasted not into the last line
if (len(pasteList) > 1) or (not self.isCursorInEditionZone()):
self.cursor.movePosition(QTextCursor.End, QTextCursor.MoveAnchor, 1)
self.setTextCursor(self.cursor)
# with multi-line text also run the commands
for line in pasteList[:-1]:
self.insertPlainText(line)
Expand Down

0 comments on commit 9b4ed0c

Please sign in to comment.