Use symmetric layout for the closing bracket in template argument lists
This commit is contained in:
parent
7137b582a7
commit
c8020d8c1c
@ -2127,21 +2127,6 @@ void ASBeautifier::computePreliminaryIndentation()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isInTemplate || isInTemplateInstantiation)
|
|
||||||
{
|
|
||||||
// Use symmetrical layout for closing brace in template argument list:
|
|
||||||
//
|
|
||||||
// template
|
|
||||||
// <
|
|
||||||
// class Argument
|
|
||||||
// >
|
|
||||||
if (lineFirstChar == '>' && !lineStartsInComment)
|
|
||||||
{
|
|
||||||
if (!inStatementIndentStack->empty())
|
|
||||||
spaceIndentCount -= inStatementIndentStack->back();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isInClassInitializer || isInEnumTypeID)
|
if (isInClassInitializer || isInEnumTypeID)
|
||||||
{
|
{
|
||||||
indentCount += classInitializerIndents;
|
indentCount += classInitializerIndents;
|
||||||
@ -2611,6 +2596,20 @@ void ASBeautifier::parseCurrentLine(const string& line)
|
|||||||
else if (ch == '>')
|
else if (ch == '>')
|
||||||
{
|
{
|
||||||
popLastInStatementIndent();
|
popLastInStatementIndent();
|
||||||
|
// Immediately reduce spaceIndentCount if the line starts
|
||||||
|
// with '>' to get a symmetrical layout:
|
||||||
|
//
|
||||||
|
// template
|
||||||
|
// <
|
||||||
|
// class Argument
|
||||||
|
// >
|
||||||
|
if (lineFirstChar == '>' && !lineStartsInComment)
|
||||||
|
{
|
||||||
|
if (!inStatementIndentStack->empty())
|
||||||
|
spaceIndentCount = inStatementIndentStack->back();
|
||||||
|
else
|
||||||
|
spaceIndentCount = 0;
|
||||||
|
}
|
||||||
if (--templateDepth <= 0)
|
if (--templateDepth <= 0)
|
||||||
{
|
{
|
||||||
ch = ';';
|
ch = ';';
|
||||||
@ -2635,7 +2634,9 @@ void ASBeautifier::parseCurrentLine(const string& line)
|
|||||||
if (isInTemplateInstantiation)
|
if (isInTemplateInstantiation)
|
||||||
{
|
{
|
||||||
inStatementIndentStackSizeStack->push_back(inStatementIndentStack->size());
|
inStatementIndentStackSizeStack->push_back(inStatementIndentStack->size());
|
||||||
registerInStatementIndent(line, i, spaceIndentCount, tabIncrementIn, 0, true);
|
// Always add one indent, i.e. do not try to align
|
||||||
|
registerInStatementIndent(line, line.length() - 1,
|
||||||
|
spaceIndentCount, tabIncrementIn, 0, true);
|
||||||
isInStatement = true;
|
isInStatement = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2645,6 +2646,20 @@ void ASBeautifier::parseCurrentLine(const string& line)
|
|||||||
&& !inStatementIndentStackSizeStack->empty())
|
&& !inStatementIndentStackSizeStack->empty())
|
||||||
{
|
{
|
||||||
popLastInStatementIndent();
|
popLastInStatementIndent();
|
||||||
|
// Immediately reduce spaceIndentCount if the line starts
|
||||||
|
// with '>' to get a symmetrical layout:
|
||||||
|
//
|
||||||
|
// template_function<
|
||||||
|
// Argument1,
|
||||||
|
// Argument2
|
||||||
|
// >
|
||||||
|
if (lineFirstChar == '>' && !lineStartsInComment)
|
||||||
|
{
|
||||||
|
if (!inStatementIndentStack->empty())
|
||||||
|
spaceIndentCount = inStatementIndentStack->back();
|
||||||
|
else
|
||||||
|
spaceIndentCount = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (--templateDepth <= 0)
|
if (--templateDepth <= 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user