mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Fix command shortcut customization
This commit is contained in:
parent
7850087d2a
commit
2f387ad9dd
@ -11,6 +11,11 @@ Change Log
|
||||
- Restore the “Keep on Top” state of windows from the last session.
|
||||
|
||||
|
||||
### Fixes
|
||||
|
||||
- Fix an issue in CotEditor 4.5.3 that some menu command shortcuts could not be customized.
|
||||
|
||||
|
||||
|
||||
4.5.3 (564)
|
||||
--------------------------
|
||||
|
@ -310,12 +310,13 @@ final class KeyBindingManager: SettingManaging {
|
||||
|
||||
menu.items
|
||||
.filter(self.allowsModifying)
|
||||
.filter(self.isModified)
|
||||
.forEach { menuItem in
|
||||
if let submenu = menuItem.submenu {
|
||||
return self.clearShortcuts(in: submenu)
|
||||
}
|
||||
|
||||
guard self.isModified(menuItem) else { return }
|
||||
|
||||
menuItem.shortcut = nil
|
||||
}
|
||||
}
|
||||
@ -328,13 +329,15 @@ final class KeyBindingManager: SettingManaging {
|
||||
|
||||
menu.items
|
||||
.filter(self.allowsModifying)
|
||||
.filter(self.isModified)
|
||||
.forEach { menuItem in
|
||||
if let submenu = menuItem.submenu {
|
||||
return self.applyShortcuts(to: submenu)
|
||||
}
|
||||
|
||||
guard let action = menuItem.action else { return }
|
||||
guard
|
||||
self.isModified(menuItem),
|
||||
let action = menuItem.action
|
||||
else { return }
|
||||
|
||||
menuItem.allowsAutomaticKeyEquivalentLocalization = false
|
||||
menuItem.shortcut = self.shortcut(for: action, tag: menuItem.tag)
|
||||
|
Loading…
Reference in New Issue
Block a user