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()
|
||||
{
|
||||
const static QString end = QString(" %1*/\n").arg(annotationsEscapeSequence);
|
||||
const static QString end = QString(" %1*/").arg(annotationsEscapeSequence);
|
||||
return end;
|
||||
}
|
||||
|
||||
static QString annotationsStart()
|
||||
{
|
||||
const static QString start = QString("\n/*%1 ").arg(annotationsEscapeSequence);
|
||||
const static QString start = QString("/*%1 ").arg(annotationsEscapeSequence);
|
||||
return start;
|
||||
}
|
||||
|
||||
@@ -944,8 +944,8 @@ void RewriterView::writeAuxiliaryData()
|
||||
QString auxData = auxiliaryDataAsQML();
|
||||
|
||||
if (!auxData.isEmpty()) {
|
||||
auxData.prepend(annotationsStart());
|
||||
auxData.append(annotationsEnd());
|
||||
auxData.prepend("\n" + annotationsStart());
|
||||
auxData.append(annotationsEnd() + "\n");
|
||||
newText.append(auxData);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user