forked from qt-creator/qt-creator
QmlDesigner: Stabilize annotation code
We have to ensure to replace old blocks if the line breaks have been removed. Change-Id: Ice63d63bd945a3477461311ee7653f0f4cb784e1 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -902,13 +902,13 @@ void RewriterView::delayedSetup()
|
|||||||
|
|
||||||
static QString annotationsEnd()
|
static QString annotationsEnd()
|
||||||
{
|
{
|
||||||
const static QString end = QString(" %1*/\n").arg(annotationsEscapeSequence);
|
const static QString end = QString(" %1*/").arg(annotationsEscapeSequence);
|
||||||
return end;
|
return end;
|
||||||
}
|
}
|
||||||
|
|
||||||
static QString annotationsStart()
|
static QString annotationsStart()
|
||||||
{
|
{
|
||||||
const static QString start = QString("\n/*%1 ").arg(annotationsEscapeSequence);
|
const static QString start = QString("/*%1 ").arg(annotationsEscapeSequence);
|
||||||
return start;
|
return start;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -944,8 +944,8 @@ void RewriterView::writeAuxiliaryData()
|
|||||||
QString auxData = auxiliaryDataAsQML();
|
QString auxData = auxiliaryDataAsQML();
|
||||||
|
|
||||||
if (!auxData.isEmpty()) {
|
if (!auxData.isEmpty()) {
|
||||||
auxData.prepend(annotationsStart());
|
auxData.prepend("\n" + annotationsStart());
|
||||||
auxData.append(annotationsEnd());
|
auxData.append(annotationsEnd() + "\n");
|
||||||
newText.append(auxData);
|
newText.append(auxData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user