mirror of
https://github.com/Microsoft/vscode
synced 2024-10-02 17:32:41 +00:00
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:
parent
a42fc9031d
commit
37a3496bb0
|
@ -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');
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}));
|
||||
|
||||
|
|
Loading…
Reference in a new issue