diff --git a/src/sql/workbench/contrib/notebook/browser/notebook.component.ts b/src/sql/workbench/contrib/notebook/browser/notebook.component.ts index 8609c80218..792011f9d2 100644 --- a/src/sql/workbench/contrib/notebook/browser/notebook.component.ts +++ b/src/sql/workbench/contrib/notebook/browser/notebook.component.ts @@ -57,9 +57,10 @@ import { IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar'; import { Emitter } from 'vs/base/common/event'; import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { KeyCode } from 'vs/base/common/keyCodes'; +import { RedoCommand, UndoCommand } from 'vs/editor/browser/editorExtensions'; export const NOTEBOOK_SELECTOR: string = 'notebook-component'; - +const PRIORITY = 105; @Component({ selector: NOTEBOOK_SELECTOR, templateUrl: decodeURI(require.toUrl('./notebook.component.html')) @@ -133,6 +134,18 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe } } })); + this._register(RedoCommand.addImplementation(PRIORITY, 'notebook-cells-undo-redo', () => { + if (this._model) { + this._model.redo(); + } + return false; + })); + this._register(UndoCommand.addImplementation(PRIORITY, 'notebook-cells-undo-redo', () => { + if (this._model) { + this._model.undo(); + } + return false; + })); } ngOnInit() {