handle raw cell multile line source

This commit is contained in:
rebornix
2020-04-01 17:34:58 -07:00
parent bd6ad5592f
commit 9f48b00f2b
3 changed files with 5 additions and 3 deletions

View File

@@ -402,11 +402,12 @@ export class NotebookEditorCellEdit {
}
}
insert(index: number, content: string, language: string, type: CellKind, outputs: vscode.CellOutput[], metadata: vscode.NotebookCellMetadata | undefined): void {
insert(index: number, content: string | string[], language: string, type: CellKind, outputs: vscode.CellOutput[], metadata: vscode.NotebookCellMetadata | undefined): void {
this._throwIfFinalized();
const sourceArr = Array.isArray(content) ? content : content.split(/\r|\n|\r\n/g);
let cell = {
source: [content],
source: sourceArr,
language,
cellKind: type,
outputs: (outputs as any[]), // TODO@rebornix