Skip to content

Commit

Permalink
use group to allow breaking
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescdavis committed Dec 5, 2022
1 parent 299bb7b commit a15c9cf
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/language-handlebars/printer-glimmer.js
Expand Up @@ -567,20 +567,22 @@ function printElseIfLikeBlock(path, print, ifLikeKeyword) {
let blockParams = [];

if (isNonEmptyArray(node.program.blockParams)) {
blockParams = [" ", ...printBlockParams(node.program)];
blockParams = [line, printBlockParams(node.program)];
}

const parentNode = path.getParentNode(1);

return [
return group([
printInverseBlockOpeningMustache(parentNode),
"else ",
ifLikeKeyword,
" ",
printParams(path, print),
...blockParams,
indent(group([
group(["else", line, ifLikeKeyword]),
line,
printParams(path, print),
])),
indent(blockParams),
softline,
printInverseBlockClosingMustache(parentNode),
];
]);
}

function printCloseBlock(path, print, options) {
Expand Down

0 comments on commit a15c9cf

Please sign in to comment.