Fix: Use more readable expression
This commit is contained in:
parent
b3946b7525
commit
ac8e34815f
|
@ -725,7 +725,7 @@ private:
|
||||||
void formatColon()
|
void formatColon()
|
||||||
{
|
{
|
||||||
import dfmt.editorconfig : OptionalBoolean;
|
import dfmt.editorconfig : OptionalBoolean;
|
||||||
import std.algorithm : canFind;
|
import std.algorithm : canFind, any;
|
||||||
|
|
||||||
immutable bool isCase = astInformation.caseEndLocations.canFindIndex(current.index);
|
immutable bool isCase = astInformation.caseEndLocations.canFindIndex(current.index);
|
||||||
immutable bool isAttribute = astInformation.attributeDeclarationLines.canFindIndex(
|
immutable bool isAttribute = astInformation.attributeDeclarationLines.canFindIndex(
|
||||||
|
@ -747,10 +747,10 @@ private:
|
||||||
newline();
|
newline();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (peekBackIs(tok!"identifier") && (peekBack2Is(tok!"{", true)
|
else if (peekBackIs(tok!"identifier")
|
||||||
|| peekBack2Is(tok!"}", true) || peekBack2Is(tok!";", true)
|
&& [tok!"{", tok!"}", tok!";", tok!":", tok!","]
|
||||||
|| peekBack2Is(tok!":", true) || peekBack2Is(tok!",", true))
|
.any!((ptrdiff_t token) => peekBack2Is(cast(IdType)token, true))
|
||||||
&& !(isBlockHeader(1) && !peekIs(tok!"if")))
|
&& (!isBlockHeader(1) || peekIs(tok!"if")))
|
||||||
{
|
{
|
||||||
writeToken();
|
writeToken();
|
||||||
if (isStructInitializer)
|
if (isStructInitializer)
|
||||||
|
|
Loading…
Reference in New Issue