Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c905fc7

Browse files
authored
Fix command prompt to look like Spyder (microsoft#5744)
* Fix command prompt to look like Spyder * Add news entry
1 parent e6a349e commit c905fc7

File tree

7 files changed

+22
-16
lines changed

7 files changed

+22
-16
lines changed

news/2 Fixes/5729.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Adjust input box prompt to look more an IPython console prompt.

package-lock.json

+14-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/datascience-ui/history-react/MainPanel.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ export class MainPanel extends React.Component<IMainPanelProps, IMainPanelState>
290290
const errorBackgroundColor = getSettings().errorBackgroundColor;
291291
const actualErrorBackgroundColor = errorBackgroundColor ? errorBackgroundColor : '#FFFFFF';
292292
const maxTextSize = maxOutputSize && maxOutputSize < 10000 && maxOutputSize > 0 ? maxOutputSize : undefined;
293+
const executionCount = this.getInputExecutionCount(this.state.cellVMs);
293294

294295
return (
295296
<div className='edit-panel'>
@@ -309,6 +310,7 @@ export class MainPanel extends React.Component<IMainPanelProps, IMainPanelState>
309310
ref={this.saveEditCellRef}
310311
gotoCode={noop}
311312
delete={noop}
313+
editExecutionCount={executionCount}
312314
onCodeCreated={this.editableCodeCreated}
313315
onCodeChange={this.codeChange}
314316
monacoTheme={this.state.monacoTheme}

src/datascience-ui/history-react/cell.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import './cell.css';
2121
import { CellButton } from './cellButton';
2222
import { Code } from './code';
2323
import { CollapseButton } from './collapseButton';
24-
import { CommandPrompt } from './commandPrompt';
2524
import { ExecutionCount } from './executionCount';
2625
import { Image, ImageName } from './image';
2726
import { InputHistory } from './inputHistory';
@@ -41,6 +40,7 @@ interface ICellProps {
4140
errorBackgroundColor: string;
4241
monacoTheme: string | undefined;
4342
editorOptions: monacoEditor.editor.IEditorOptions;
43+
editExecutionCount: number;
4444
gotoCode(): void;
4545
delete(): void;
4646
submitNewCode(code: string): void;
@@ -187,7 +187,7 @@ export class Cell extends React.Component<ICellProps> {
187187
return this.props.cellVM.editable ?
188188
(
189189
<div className='controls-div'>
190-
<CommandPrompt />
190+
<ExecutionCount isBusy={busy} count={this.props.editExecutionCount.toString()} visible={this.isCodeCell()} />
191191
</div>
192192
) : (
193193
<div className='controls-div'>

src/datascience-ui/history-react/code.css

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
position: relative;
44
width:100%;
55
margin-bottom:16px;
6+
top: -2px; /* Account for spacing removed from the monaco editor */
67
}
78

89
.code-area-editable {

src/datascience-ui/history-react/contentPanel.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export class ContentPanel extends React.Component<IContentPanelProps> {
7575
baseTheme={baseTheme}
7676
codeTheme={this.props.codeTheme}
7777
showWatermark={false}
78+
editExecutionCount={0}
7879
errorBackgroundColor={actualErrorBackgroundColor}
7980
gotoCode={() => this.props.gotoCellCode(index)}
8081
delete={() => this.props.deleteCell(index)}

src/datascience-ui/history-react/executionCount.css

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
font-weight: bold;
44
display:flex;
55
color: var(--code-comment-color);
6+
font-family: var(--code-font-family);
67
}
78

89
.execution-count-busy-outer {

0 commit comments

Comments
 (0)