Fix redo keyboard shortcut in notebook markdown (#13967)

* add cmd+y for redo

* add ctrl+shift+z for redo

* remove listener for redo when in markdown mode
This commit is contained in:
Lucy Zhang
2021-01-15 08:24:06 -08:00
committed by GitHub
parent 09cce42233
commit 8671b6aa5d

View File

@@ -71,7 +71,7 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
// select the active .
if ((e.ctrlKey || e.metaKey) && e.key === 'a') {
preventDefaultAndExecCommand(e, 'selectAll');
} else if ((e.metaKey && e.shiftKey && e.key === 'z') || (e.ctrlKey && e.key === 'y')) {
} else if ((e.metaKey && e.shiftKey && e.key === 'z') || (e.ctrlKey && e.key === 'y') && !this.markdownMode) {
preventDefaultAndExecCommand(e, 'redo');
} else if ((e.ctrlKey || e.metaKey) && e.key === 'z') {
preventDefaultAndExecCommand(e, 'undo');