Skip to content

Commit

Permalink
repl: variables and expressions with children do not preserve whitespace
Browse files Browse the repository at this point in the history
fixes #18937
fixes #18942
  • Loading branch information
isidorn committed Jan 23, 2017
1 parent 7111803 commit ed900e4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/vs/workbench/parts/debug/electron-browser/replViewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ export class ReplExpressionsRenderer implements IRenderer {
}

public getHeight(tree: ITree, element: any): number {
if (element instanceof Variable) {
return ReplExpressionsRenderer.LINE_HEIGHT_PX;
}
if (element instanceof Expression && element.hasChildren) {
return 2 * ReplExpressionsRenderer.LINE_HEIGHT_PX;
}

return this.getHeightForString(element.value) + (element instanceof Expression ? this.getHeightForString(element.name) : 0);
}

Expand Down Expand Up @@ -217,7 +224,7 @@ export class ReplExpressionsRenderer implements IRenderer {
private renderExpression(tree: ITree, expression: IExpression, templateData: IExpressionTemplateData): void {
templateData.input.textContent = expression.name;
renderExpressionValue(expression, templateData.value, {
preserveWhitespace: true,
preserveWhitespace: !expression.hasChildren,
showHover: false
});
if (expression.hasChildren) {
Expand Down

0 comments on commit ed900e4

Please sign in to comment.