From 6e11c52dc933027ca5131bddf999953d1142edda Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Thu, 28 Jun 2018 20:38:25 +0200 Subject: make paste work, fix inserting in wrong lines --- 3rdparty/python-console/modified/pyconsole.cc | 30 ++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to '3rdparty/python-console/modified/pyconsole.cc') diff --git a/3rdparty/python-console/modified/pyconsole.cc b/3rdparty/python-console/modified/pyconsole.cc index 35f3e930..186d74d2 100644 --- a/3rdparty/python-console/modified/pyconsole.cc +++ b/3rdparty/python-console/modified/pyconsole.cc @@ -52,7 +52,8 @@ void PythonConsole::keyPressEvent( QKeyEvent* e ) if ( ! canGoLeft( ) ) return; } - + if (!cursorIsOnInputLine()) return; + if (textCursor().columnNumber() < PythonConsole::PROMPT.size()) return; QTextEdit::keyPressEvent( e ); } @@ -292,3 +293,30 @@ void PythonConsole::moveCursorToEnd( ) cursor.movePosition( QTextCursor::End ); setTextCursor( cursor ); } + +void PythonConsole::insertFromMimeData(const QMimeData *src) +{ + if (src->hasText()) { + QStringList list = src->text().split("\n",QString::KeepEmptyParts); + bool lastends = src->text().endsWith("\n"); + for (int i=0;i