Add indentation for end-of-line "->"
template<typename U> static auto test(int) -> decltype(std::declval<U>().function(), yes());
This commit is contained in:
parent
77516152ef
commit
575c2d2e1f
@ -3531,6 +3531,25 @@ void ASBeautifier::parseCurrentLine(const string& line)
|
|||||||
if (isCStyle() && foundNonAssignmentOp == &AS_ARROW)
|
if (isCStyle() && foundNonAssignmentOp == &AS_ARROW)
|
||||||
{
|
{
|
||||||
potentialTemplateDisambiguator = true;
|
potentialTemplateDisambiguator = true;
|
||||||
|
|
||||||
|
// Add indent for end-of-line "->"
|
||||||
|
if (parenDepth == 0 && !isInStatement && !isInTemplate)
|
||||||
|
{
|
||||||
|
// is -> at end of line?
|
||||||
|
size_t nextChar = line.find_first_not_of(" \t", i + 1);
|
||||||
|
if (nextChar != string::npos)
|
||||||
|
{
|
||||||
|
if (line.compare(nextChar, 2, "//") == 0
|
||||||
|
|| line.compare(nextChar, 2, "/*") == 0)
|
||||||
|
nextChar = string::npos;
|
||||||
|
}
|
||||||
|
// register indent
|
||||||
|
if (nextChar == string::npos)
|
||||||
|
{
|
||||||
|
registerInStatementIndent(line, i, spaceIndentCount, tabIncrementIn, 0, false);
|
||||||
|
isInStatement = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// For C++ input/output, operator<< and >> should be
|
// For C++ input/output, operator<< and >> should be
|
||||||
|
Loading…
x
Reference in New Issue
Block a user