1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-28 08:13:17 +03:00

Make reset to defaults work again

This commit is contained in:
Tae Won Ha 2020-02-07 18:32:34 +01:00
parent d63fbda4c4
commit 830a6eafd5
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44

View File

@ -244,10 +244,13 @@ extension ShortcutsPref {
alert.beginSheetModal(for: window, completionHandler: { response in alert.beginSheetModal(for: window, completionHandler: { response in
guard response == .alertSecondButtonReturn else { return } guard response == .alertSecondButtonReturn else { return }
self.traverseMenuItems { identifier, _ in self.traverseMenuItems { identifier, _ in
self.shortcutsDefaultsController.setValue( let shortcut = defaultShortcuts[identifier] ?? Shortcut(keyEquivalent: "")
legacyDefaultShortcuts[identifier], let valueToWrite = ValueTransformer
forKeyPath: "values.\(identifier)" .keyedUnarchiveFromDataTransformer
) .reverseTransformedValue(shortcut)
self.shortcutsDefaultsController.setValue(valueToWrite, forKeyPath: "values.\(identifier)")
self.treeController.rearrangeObjects()
} }
}) })
} }