diff --git a/src/app/app.less b/src/app/app.less index c974ae4d..11bbca7e 100644 --- a/src/app/app.less +++ b/src/app/app.less @@ -418,6 +418,11 @@ a.a-block { padding-top: 5px; } +.plugin-info-text { + color: @term-white; + padding-top: 5px; +} + .view-error { padding: 10px 20px; } diff --git a/src/plugins/code/code.tsx b/src/plugins/code/code.tsx index 87da0780..24fc305c 100644 --- a/src/plugins/code/code.tsx +++ b/src/plugins/code/code.tsx @@ -71,12 +71,13 @@ class SourceCodeRenderer extends React.Component< const editorHeight = Math.max(props.savedHeight - 25, 0); // must subtract the padding/margin to get the real editorHeight this.markdownRef = React.createRef(); this.syncing = false; + let isClosed = props.lineState["prompt:closed"]; this.state = { code: null, languages: [], selectedLanguage: "", isSave: false, - isClosed: false, + isClosed: isClosed, editorHeight, message: null, isPreviewerAvailable: false, @@ -92,11 +93,11 @@ class SourceCodeRenderer extends React.Component< this.cacheKey = `${screenId}-${lineId}-${this.filePath}`; const code = SourceCodeRenderer.codeCache.get(this.cacheKey); if (code) { - this.setState({ code, isClosed: this.props.lineState["prompt:closed"] }); + this.setState({ code }); } else { this.props.data.text().then((code) => { this.originalCode = code; - this.setState({ code, isClosed: this.props.lineState["prompt:closed"] }); + this.setState({ code }); SourceCodeRenderer.codeCache.set(this.cacheKey, code); }); } @@ -417,10 +418,13 @@ class SourceCodeRenderer extends React.Component< render() { const { exitcode } = this.props; const { code, message, isPreviewerAvailable, showPreview, editorFraction } = this.state; - - if (code == null) return
; - - if (exitcode === 1) + if (this.state.isClosed) { + return ; + } + if (code == null) { + return ; + } + if (exitcode === 1) { return (