ui: Fixed additional newline in every code snippet

This commit is contained in:
Eberhard Graether
2017-10-24 17:34:33 +02:00
parent 2218ab96aa
commit 0c2fa352c1
+5
View File
@@ -42,6 +42,11 @@ QtCodeField::QtCodeField(
viewport()->setCursor(Qt::ArrowCursor);
std::string displayCode = m_code;
if (!m_locationFile->isWhole() && !displayCode.empty() && *displayCode.rbegin() == '\n')
{
displayCode.pop_back();
}
setPlainText(QString::fromUtf8(displayCode.c_str()));
createLineLengthCache();