Skip to content

Commit

Permalink
fix markdown cell convert (#8390)
Browse files Browse the repository at this point in the history
  • Loading branch information
IanMatthewHuff authored Nov 6, 2019
1 parent ea0dc14 commit 9db47aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/2 Fixes/8386.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Correctly transition markdown cells into code cells.
4 changes: 2 additions & 2 deletions src/datascience-ui/interactive-common/mainStateController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,8 @@ export class MainStateController implements IMessageHandler {
if (index >= 0 && this.pendingState.cellVMs[index].cell.data.cell_type !== newType) {
const cellVMs = [...this.pendingState.cellVMs];
const current = this.pendingState.cellVMs[index];
const newSource = current.focused ? this.getMonacoEditorContents(cellId) : current.cell.data.source;
const newCell = { ...current, inputBlockText: newSource, cell: { ...current.cell, state: CellState.executing, data: { ...current.cell.data, cell_type: newType, source: newSource } } };
const newSource = current.focused ? this.getMonacoEditorContents(cellId) : concatMultilineStringInput(current.cell.data.source);
const newCell = { ...current, inputBlockText: newSource, cell: { ...current.cell, state: CellState.finished, data: { ...current.cell.data, cell_type: newType, source: newSource } } };
// tslint:disable-next-line: no-any
cellVMs[index] = (newCell as any); // This is because IMessageCell doesn't fit in here. But message cells can't change type
this.setState({ cellVMs });
Expand Down

0 comments on commit 9db47aa

Please sign in to comment.