1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-26 23:36:08 +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
guard response == .alertSecondButtonReturn else { return }
self.traverseMenuItems { identifier, _ in
self.shortcutsDefaultsController.setValue(
legacyDefaultShortcuts[identifier],
forKeyPath: "values.\(identifier)"
)
let shortcut = defaultShortcuts[identifier] ?? Shortcut(keyEquivalent: "")
let valueToWrite = ValueTransformer
.keyedUnarchiveFromDataTransformer
.reverseTransformedValue(shortcut)
self.shortcutsDefaultsController.setValue(valueToWrite, forKeyPath: "values.\(identifier)")
self.treeController.rearrangeObjects()
}
})
}