Skip to content

Commit 37a3496

Browse files
committed
share undo stack between text models in a notebook. the undo stack is not shared with notebook itself yet due to microsoft#98750.
1 parent a42fc90 commit 37a3496

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

extensions/vscode-notebook-tests/src/notebook.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ suite('notebook dirty state', () => {
480480
});
481481

482482
suite('notebook undo redo', () => {
483-
test.skip('notebook open', async function () {
483+
test('notebook open', async function () {
484484
const resource = vscode.Uri.parse(join(vscode.workspace.rootPath || '', './first.vsctestnb'));
485485
await vscode.commands.executeCommand('vscode.openWith', resource, 'notebookCoreTest');
486486
assert.equal(vscode.notebook.activeNotebookEditor !== undefined, true, 'notebook first');

src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,23 @@ export class NotebookContribution extends Disposable implements IWorkbenchContri
126126

127127
this._register(undoRedoService.registerUriComparisonKeyComputer({
128128
getComparisonKey: (uri: URI): string | null => {
129-
// !!! Leave a fast check statement here !!!
130129
if (uri.scheme !== CellUri.scheme) {
131130
return null;
132131
}
132+
133133
const data = CellUri.parse(uri);
134134
if (!data) {
135135
return null;
136136
}
137-
return data.notebook.toString();
137+
138+
return data.notebook.scheme + ':' + data.notebook.fsPath;
139+
140+
// const documentUri = this._resourceMapping.get(data.notebook)?.resource;
141+
// if (documentUri) {
142+
// return documentUri.toString();
143+
// }
144+
145+
// return null;
138146
}
139147
}));
140148

0 commit comments

Comments
 (0)