share undo stack between text models in a notebook. the undo stack is not shared with notebook itself yet due to #98750.

This commit is contained in:
rebornix 2020-05-28 10:28:54 -07:00
parent a42fc9031d
commit 37a3496bb0
2 changed files with 11 additions and 3 deletions

View file

@ -480,7 +480,7 @@ suite('notebook dirty state', () => {
});
suite('notebook undo redo', () => {
test.skip('notebook open', async function () {
test('notebook open', async function () {
const resource = vscode.Uri.parse(join(vscode.workspace.rootPath || '', './first.vsctestnb'));
await vscode.commands.executeCommand('vscode.openWith', resource, 'notebookCoreTest');
assert.equal(vscode.notebook.activeNotebookEditor !== undefined, true, 'notebook first');

View file

@ -126,15 +126,23 @@ export class NotebookContribution extends Disposable implements IWorkbenchContri
this._register(undoRedoService.registerUriComparisonKeyComputer({
getComparisonKey: (uri: URI): string | null => {
// !!! Leave a fast check statement here !!!
if (uri.scheme !== CellUri.scheme) {
return null;
}
const data = CellUri.parse(uri);
if (!data) {
return null;
}
return data.notebook.toString();
return data.notebook.scheme + ':' + data.notebook.fsPath;
// const documentUri = this._resourceMapping.get(data.notebook)?.resource;
// if (documentUri) {
// return documentUri.toString();
// }
// return null;
}
}));