fix: Cancel editing shortcut on Windows

fix: Improve display of symbols in keyboard shortcuts dialog
closes #2733
This commit is contained in:
Tom Moor
2022-02-17 23:10:11 -08:00
parent 9db6951434
commit 2ca68c2c80
3 changed files with 47 additions and 35 deletions

View File

@@ -15,19 +15,22 @@ export default class Keys extends Extension {
}
keys(): Record<string, Command> {
const onCancel = () => {
if (this.options.onCancel) {
this.options.onCancel();
return true;
}
return false;
};
return {
// No-ops prevent Tab escaping the editor bounds
Tab: () => true,
"Shift-Tab": () => true,
// Shortcuts for when editor has separate edit mode
Escape: () => {
if (this.options.onCancel) {
this.options.onCancel();
return true;
}
return false;
},
"Mod-Escape": onCancel,
"Shift-Escape": onCancel,
"Mod-s": () => {
if (this.options.onSave) {
this.options.onSave();