Skip to content

Commit

Permalink
fix(history): use correct shortcuts for undo/redo
Browse files Browse the repository at this point in the history
  • Loading branch information
webkadiz committed Sep 22, 2023
1 parent 7832b96 commit 520ce79
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/extension-history/src/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,8 @@ export const History = Extension.create<HistoryOptions>({
addKeyboardShortcuts() {
return {
'Mod-z': () => this.editor.commands.undo(),
'Mod-Z': () => this.editor.commands.undo(),
'Mod-y': () => this.editor.commands.redo(),
'Mod-Y': () => this.editor.commands.redo(),
'Shift-Mod-z': () => this.editor.commands.redo(),
'Shift-Mod-Z': () => this.editor.commands.redo(),
'Mod-y': () => this.editor.commands.redo(),

// Russian keyboard layouts
'Mod-я': () => this.editor.commands.undo(),
Expand Down

2 comments on commit 520ce79

@vinzdef
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@webkadiz these shortcuts were in place because of #4055 in #4132

Any reason why these got removed? Was the problem solved elsewhere?
The bug linked above is back (Capslock interfers with shortcuts in Windows), so I've opened a new one (#5789)

@webkadiz
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I didn't know about caps lock, their disappearance really breaks it

I cleaned them for 2 reasons:

  1. Mod-Z was executed before Ctrl-Shift-z, and this is wrong, and their behavior is different, this can be solved by adding auxiliary caps lock hotkeys after the rest
  2. When we get to the end of the redo stack, and at this moment we press Ctrl-Shift-z, which is responsible for another step redo, nothing should happen in this situation, but Mod-Z is fired up, which does undo, which is incorrect, how to fix it I did not find an option

Please sign in to comment.