feat: add `dfmt_single_template_constraint_indent`

Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
This commit is contained in:
Prajwal S N 2024-01-12 12:23:31 +05:30
parent 325f093091
commit 864caada43
No known key found for this signature in database
GPG Key ID: 60701A603988FAC2
1 changed files with 7 additions and 2 deletions

View File

@ -3304,10 +3304,14 @@ extern (C++) class FormatVisitor : SemanticTimeTransitiveVisitor
case TemplateConstraintStyle.conditional_newline_indent:
useTempBuf = true;
depth++;
if (config.dfmt_single_template_constraint_indent)
depth++;
break;
case TemplateConstraintStyle.always_newline_indent:
newline();
depth++;
if (config.dfmt_single_template_constraint_indent)
depth++;
break;
case TemplateConstraintStyle.conditional_newline:
useTempBuf = true;
@ -3332,10 +3336,11 @@ extern (C++) class FormatVisitor : SemanticTimeTransitiveVisitor
if (!conditionalNewline())
buf.put(' ');
writeTempBuf();
depth--;
break;
goto case;
case TemplateConstraintStyle.always_newline_indent:
depth--;
if (config.dfmt_single_template_constraint_indent)
depth--;
break;
case TemplateConstraintStyle.conditional_newline:
if (!conditionalNewline())