Skip to content

Commit

Permalink
Fix repl output not wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
remo5000 committed May 24, 2018
1 parent ebf1adf commit 4f75ca2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions src/components/IDE/Repl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,44 +36,44 @@ export const Output: React.SFC<IOutputProps> = props => {
case 'code':
return (
<Card>
<code>{props.output.value}</code>
<pre>{props.output.value}</pre>
</Card>
)
case 'running':
return (
<Card>
<code>{props.output.consoleLogs.join('\n')}</code>
<pre>{props.output.consoleLogs.join('\n')}</pre>
</Card>
)
case 'result':
if (props.output.consoleLogs.length === 0) {
return (
<Card>
<code>{toString(props.output.value)}</code>
<pre>{toString(props.output.value)}</pre>
</Card>
)
} else {
return (
<Card>
<code>
<pre>
{[props.output.consoleLogs.join('\n'), toString(props.output.value)].join('\n')}
</code>
</pre>
</Card>
)
}
case 'errors':
if (props.output.consoleLogs.length === 0) {
return (
<Card>
<code>{parseError(props.output.errors)}</code>
<pre>{parseError(props.output.errors)}</pre>
</Card>
)
} else {
return (
<Card>
<code>
<pre>
{[props.output.consoleLogs.join('\n'), parseError(props.output.errors)].join('\n')}
</code>
</pre>
</Card>
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/IDE/ReplControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class ReplControl extends React.Component<IReplControlProps, {}> {
return (
<div className="row end-xs">
<div className="pt-control-group pt-fill">
{evalButton}
{clearButton}
{evalButton}
{clearButton}
</div>
</div>
)
Expand Down
4 changes: 2 additions & 2 deletions src/components/IDE/__tests__/__snapshots__/Repl.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

exports[`Output renders correctly for InterpreterOutput.type === 'result' 1`] = `
"<Blueprint2.Card elevation={0} interactive={false}>
<code>
<pre>
&quot;def&quot;
</code>
</pre>
</Blueprint2.Card>"
`;

Expand Down
4 changes: 2 additions & 2 deletions src/styles/_ide.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@
margin: 0.5rem;
margin-top: 0rem;

code {
pre {
background-color: transparent;
box-shadow: none;
color: inherit;
padding: 0px;
white-space: pre;
white-space: pre-wrap;
}
}

Expand Down

0 comments on commit 4f75ca2

Please sign in to comment.