Commit 05d8aeae authored by Aurindam Jana's avatar Aurindam Jana
Browse files

QmlJSScriptConsole: Multi line expressions



Move the cursor to the End of the document instead of
checking for NextWord or EndOfLine. This fix handles multi
line expressions correctly.

Change-Id: Idb165447d3e450e8ca3274944a3879af28e7f96e
Reviewed-by: default avatarKai Koehne <kai.koehne@nokia.com>
parent 727dd1b1
......@@ -218,7 +218,7 @@ void QmlJSScriptConsole::appendResult(const QString &result)
d->appendToHistory(currentScript);
QTextCursor cur = textCursor();
cur.movePosition(QTextCursor::EndOfLine);
cur.movePosition(QTextCursor::End);
cur.insertText(_("\n"));
cur.insertText(result);
cur.movePosition(QTextCursor::EndOfLine);
......@@ -527,7 +527,7 @@ QString QmlJSScriptConsole::getCurrentScript() const
{
QTextCursor cursor = textCursor();
cursor.setPosition(d->startOfEditableArea);
while (cursor.movePosition(QTextCursor::NextWord, QTextCursor::KeepAnchor)) ;
while (cursor.movePosition(QTextCursor::End, QTextCursor::KeepAnchor)) ;
QString script = cursor.selectedText();
cursor.clearSelection();
//remove trailing white space
......@@ -541,7 +541,7 @@ void QmlJSScriptConsole::replaceCurrentScript(const QString &script)
{
QTextCursor cursor = textCursor();
cursor.setPosition(d->startOfEditableArea);
while (cursor.movePosition(QTextCursor::NextWord, QTextCursor::KeepAnchor)) ;
while (cursor.movePosition(QTextCursor::End, QTextCursor::KeepAnchor)) ;
cursor.deleteChar();
cursor.insertText(script);
setTextCursor(cursor);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment