Commit 844db3d7 authored by con's avatar con
Browse files

Fix adding of endlines to application output.

parent 85596e7b
...@@ -49,6 +49,8 @@ ...@@ -49,6 +49,8 @@
#include <QtGui/QVBoxLayout> #include <QtGui/QVBoxLayout>
#include <QtGui/QTabWidget> #include <QtGui/QTabWidget>
#include <QtGui/QApplication>
using namespace ProjectExplorer::Internal; using namespace ProjectExplorer::Internal;
using namespace ProjectExplorer; using namespace ProjectExplorer;
...@@ -391,12 +393,13 @@ OutputWindow::~OutputWindow() ...@@ -391,12 +393,13 @@ OutputWindow::~OutputWindow()
void OutputWindow::appendOutput(const QString &out) void OutputWindow::appendOutput(const QString &out)
{ {
setMaximumBlockCount(MaxBlockCount); setMaximumBlockCount(MaxBlockCount);
moveCursor(QTextCursor::End);
if (out.endsWith('\n')) if (out.endsWith('\n'))
appendPlainText(out.right(out.length()-1)); insertPlainText(out.right(out.length()-1));
else else
appendPlainText(out); insertPlainText(out);
// insert newline and get automatic scroll behavior
appendPlainText(""); // makes sure that there's an newline in front
enableUndoRedo(); enableUndoRedo();
} }
......
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