diff --git a/gui/codeeditor.cpp b/gui/codeeditor.cpp index bf0959529..ab2ef41ba 100644 --- a/gui/codeeditor.cpp +++ b/gui/codeeditor.cpp @@ -144,6 +144,8 @@ void CodeEditor::setError(const QString &code, int errorLine, const QStringList tc.setPosition(mErrorPosition); setTextCursor(tc); centerCursor(); + + highlightErrorLine(); } int CodeEditor::lineNumberAreaWidth() @@ -182,12 +184,8 @@ void CodeEditor::resizeEvent(QResizeEvent *event) lineNumberArea->setGeometry(QRect(cr.left(), cr.top(), lineNumberAreaWidth(), cr.height())); } -void CodeEditor::highlightCurrentLine() +void CodeEditor::highlightErrorLine() { - QTextCursor tc = textCursor(); - tc.setPosition(mErrorPosition); - setTextCursor(tc); - QList extraSelections; QTextEdit::ExtraSelection selection; @@ -196,7 +194,8 @@ void CodeEditor::highlightCurrentLine() selection.format.setBackground(lineColor); selection.format.setProperty(QTextFormat::FullWidthSelection, true); - selection.cursor = textCursor(); + selection.cursor = QTextCursor(document()); + selection.cursor.setPosition(mErrorPosition); selection.cursor.clearSelection(); extraSelections.append(selection); diff --git a/gui/codeeditor.h b/gui/codeeditor.h index 352bb4b58..00d721de4 100644 --- a/gui/codeeditor.h +++ b/gui/codeeditor.h @@ -61,7 +61,7 @@ protected: private slots: void updateLineNumberAreaWidth(int newBlockCount); - void highlightCurrentLine(); + void highlightErrorLine(); void updateLineNumberArea(const QRect &, int); private: diff --git a/gui/resultsview.ui b/gui/resultsview.ui index fd3a455b0..356cf0de7 100644 --- a/gui/resultsview.ui +++ b/gui/resultsview.ui @@ -140,9 +140,15 @@ 4 - + false + + QPlainTextEdit::NoWrap + + + true +