forked from qt-creator/qt-creator
QmlJs: avoid adding unnecessary lines in reformatting
The reformatter used to add unnecessary empty lines, notably before comments after import declarations. Task-number: QTCREATORBUG-18332 Change-Id: I96d6f2dd53d1197aa6bc0b834971a66861b2f498 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
This commit is contained in:
@@ -187,7 +187,7 @@ protected:
|
||||
{
|
||||
SourceLocation fixedLoc = commentLoc;
|
||||
fixCommentLocation(fixedLoc);
|
||||
if (precededByEmptyLine(fixedLoc))
|
||||
if (precededByEmptyLine(fixedLoc) && !_result.endsWith(QLatin1String("\n\n")))
|
||||
newLine();
|
||||
outCommentText(toString(fixedLoc)); // don't use the sourceloc overload here
|
||||
if (followedByNewLine(fixedLoc))
|
||||
|
Reference in New Issue
Block a user