mirror of
https://github.com/qvacua/vimr.git
synced 2024-12-24 22:33:52 +03:00
Merge remote-tracking branch 'origin/develop' into update-neovim
This commit is contained in:
commit
ed594f72d0
2
Cartfile
2
Cartfile
@ -5,7 +5,7 @@ github "ReactiveX/RxSwift" == 5.0.1
|
||||
github "a2/MessagePack.swift" == 3.0.1
|
||||
github "qvacua/CocoaFontAwesome" "master"
|
||||
github "qvacua/CocoaMarkdown" "master"
|
||||
github "qvacua/ShortcutRecorder" "temporary"
|
||||
github "Kentzo/ShortcutRecorder" == 3.1
|
||||
github "qvacua/Sparkle" == 1.21.3-qvacua
|
||||
github "qvacua/swifter" "nonpublic"
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
github "IBM-Swift/BlueSocket" "1.0.52"
|
||||
github "Kentzo/ShortcutRecorder" "3.1"
|
||||
github "PureLayout/PureLayout" "v3.1.5"
|
||||
github "Quick/Nimble" "v8.0.4"
|
||||
github "ReactiveX/RxSwift" "5.0.1"
|
||||
@ -7,7 +8,6 @@ github "elegantchaos/DictionaryCoding" "1.0.7"
|
||||
github "eonil/FSEvents" "0.1.5"
|
||||
github "qvacua/CocoaFontAwesome" "fc2a08babd676525ced68061b19ad8ff3dd1d0b3"
|
||||
github "qvacua/CocoaMarkdown" "c58166490a71ad4d8466f7e7b9faf7cb0917c42f"
|
||||
github "qvacua/ShortcutRecorder" "71baf522a1e57b5f130055e33dcd800687f6ea80"
|
||||
github "qvacua/Sparkle" "1.21.3-qvacua"
|
||||
github "qvacua/swifter" "1905655ceedec5b5768f2089ceccf31621f6230a"
|
||||
github "sindresorhus/github-markdown-css" "v3.0.1"
|
||||
|
@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>SNAPSHOT-336</string>
|
||||
<string>0.31.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>336</string>
|
||||
<string>337</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>SNAPSHOT-336</string>
|
||||
<string>0.31.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>336</string>
|
||||
<string>337</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
@ -38,9 +38,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>SNAPSHOT-336</string>
|
||||
<string>0.31.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>336</string>
|
||||
<string>337</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
@ -1146,7 +1146,7 @@
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 336;
|
||||
CURRENT_PROJECT_VERSION = 337;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
@ -1208,7 +1208,7 @@
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 336;
|
||||
CURRENT_PROJECT_VERSION = 337;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
@ -1238,7 +1238,7 @@
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 336;
|
||||
DYLIB_CURRENT_VERSION = 337;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../Carthage/Build/Mac";
|
||||
FRAMEWORK_VERSION = A;
|
||||
@ -1260,7 +1260,7 @@
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 336;
|
||||
DYLIB_CURRENT_VERSION = 337;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../Carthage/Build/Mac";
|
||||
FRAMEWORK_VERSION = A;
|
||||
|
@ -15,9 +15,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>SNAPSHOT-336</string>
|
||||
<string>0.31.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>336</string>
|
||||
<string>337</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2017 Tae Won Ha. All rights reserved.</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
|
@ -15,8 +15,8 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>SNAPSHOT-336</string>
|
||||
<string>0.31.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>336</string>
|
||||
<string>337</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
@ -1920,7 +1920,7 @@
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 336;
|
||||
CURRENT_PROJECT_VERSION = 337;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
@ -1981,7 +1981,7 @@
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 336;
|
||||
CURRENT_PROJECT_VERSION = 337;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
|
@ -6,7 +6,41 @@
|
||||
import Foundation
|
||||
import ShortcutRecorder
|
||||
|
||||
let defaultShortcuts: [String: [String: Any]] = [
|
||||
let defaultShortcuts: [String: Shortcut?] = [
|
||||
"com.qvacua.vimr.menuitems.edit.copy": Shortcut(keyEquivalent: "⌘C"),
|
||||
"com.qvacua.vimr.menuitems.edit.cut": Shortcut(keyEquivalent: "⌘X"),
|
||||
"com.qvacua.vimr.menuitems.edit.delete": Shortcut(keyEquivalent: ""),
|
||||
"com.qvacua.vimr.menuitems.edit.paste": Shortcut(keyEquivalent: "⌘V"),
|
||||
"com.qvacua.vimr.menuitems.edit.redo": Shortcut(keyEquivalent: "⇧⌘Z"),
|
||||
"com.qvacua.vimr.menuitems.edit.select-all": Shortcut(keyEquivalent: "⌘A"),
|
||||
"com.qvacua.vimr.menuitems.edit.undo": Shortcut(keyEquivalent: "⌘Z"),
|
||||
"com.qvacua.vimr.menuitems.file.close": Shortcut(keyEquivalent: "⌘W"),
|
||||
"com.qvacua.vimr.menuitems.file.close-window": Shortcut(keyEquivalent: "⇧⌘W"),
|
||||
"com.qvacua.vimr.menuitems.file.new": Shortcut(keyEquivalent: "⌘N"),
|
||||
"com.qvacua.vimr.menuitems.file.new-tab": Shortcut(keyEquivalent: "⌘T"),
|
||||
"com.qvacua.vimr.menuitems.file.open-in-new-window": Shortcut(keyEquivalent: "⌥⌘O"),
|
||||
"com.qvacua.vimr.menuitems.file.open-quickly": Shortcut(keyEquivalent: "⇧⌘O"),
|
||||
"com.qvacua.vimr.menuitems.file.open": Shortcut(keyEquivalent: "⌘O"),
|
||||
"com.qvacua.vimr.menuitems.file.save-as": Shortcut(keyEquivalent: "⇧⌘S"),
|
||||
"com.qvacua.vimr.menuitems.file.save": Shortcut(keyEquivalent: "⌘S"),
|
||||
"com.qvacua.vimr.menuitems.help.vimr-help": Shortcut(keyEquivalent: ""),
|
||||
"com.qvacua.vimr.menuitems.tools.focus-neovim-view": Shortcut(keyEquivalent: "⌘."),
|
||||
"com.qvacua.vimr.menuitems.tools.toggle-all-tools": Shortcut(keyEquivalent: "⌘\\"),
|
||||
"com.qvacua.vimr.menuitems.tools.toggle-file-browser": Shortcut(keyEquivalent: "⌘1"),
|
||||
"com.qvacua.vimr.menuitems.tools.toggle-buffer-list": Shortcut(keyEquivalent: "⌘2"),
|
||||
"com.qvacua.vimr.menuitems.tools.toggle-markdown-preview": Shortcut(keyEquivalent: "⌘3"),
|
||||
"com.qvacua.vimr.menuitems.tools.toggle-html-preview": Shortcut(keyEquivalent: "⌘4"),
|
||||
"com.qvacua.vimr.menuitems.tools.toggle-tool-buttons": Shortcut(keyEquivalent: "⇧⌘\\"),
|
||||
"com.qvacua.vimr.menuitems.view.enter-full-screen": Shortcut(keyEquivalent: "⌃⌘F"),
|
||||
"com.qvacua.vimr.menuitems.view.font.bigger": Shortcut(keyEquivalent: "⌘+"),
|
||||
"com.qvacua.vimr.menuitems.view.font.reset-to-default-size": Shortcut(keyEquivalent: "⌘0"),
|
||||
"com.qvacua.vimr.menuitems.view.font.smaller": Shortcut(keyEquivalent: "⌘-"),
|
||||
"com.qvacua.vimr.menuitems.window.bring-all-to-front": Shortcut(keyEquivalent: ""),
|
||||
"com.qvacua.vimr.menuitems.window.minimize": Shortcut(keyEquivalent: "⌘M"),
|
||||
"com.qvacua.vimr.menuitems.window.zoom": Shortcut(keyEquivalent: ""),
|
||||
]
|
||||
|
||||
let legacyDefaultShortcuts: [String: [String: Any]] = [
|
||||
"com.qvacua.vimr.menuitems.edit.copy": [
|
||||
SRShortcutCharacters: "c",
|
||||
SRShortcutCharactersIgnoringModifiers: "c",
|
||||
|
@ -81,4 +81,10 @@ extension URL {
|
||||
}
|
||||
}
|
||||
|
||||
extension ValueTransformer {
|
||||
|
||||
static var keyedUnarchiveFromDataTransformer
|
||||
= ValueTransformer(forName: .keyedUnarchiveFromDataTransformerName)!
|
||||
}
|
||||
|
||||
private let log = OSLog(subsystem: Defs.loggerSubsystem, category: Defs.LoggerCategory.general)
|
||||
|
@ -1224,7 +1224,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>SNAPSHOT-336</string>
|
||||
<string>0.31.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
@ -1241,7 +1241,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>336</string>
|
||||
<string>337</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.productivity</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
|
@ -7,41 +7,29 @@ import Cocoa
|
||||
|
||||
class ShortcutItem: NSObject, Comparable {
|
||||
|
||||
static func <(lhs: ShortcutItem, rhs: ShortcutItem) -> Bool {
|
||||
return lhs.title < rhs.title
|
||||
}
|
||||
static func <(lhs: ShortcutItem, rhs: ShortcutItem) -> Bool { lhs.title < rhs.title }
|
||||
|
||||
@objc dynamic var title: String
|
||||
@objc dynamic var isLeaf: Bool
|
||||
|
||||
@objc dynamic var childrenCount: Int {
|
||||
return self.children?.count ?? -1
|
||||
}
|
||||
@objc dynamic var childrenCount: Int { self.children?.count ?? -1 }
|
||||
|
||||
var identifier: String? {
|
||||
return self.item?.identifier?.rawValue
|
||||
}
|
||||
var identifier: String? { self.item?.identifier?.rawValue }
|
||||
|
||||
var isContainer: Bool {
|
||||
return !self.isLeaf
|
||||
}
|
||||
var isContainer: Bool { !self.isLeaf }
|
||||
|
||||
override var description: String {
|
||||
return "<ShortcutItem: \(title), " +
|
||||
"id: '\(self.identifier ?? "")', " +
|
||||
"isLeaf: \(self.isLeaf), " +
|
||||
"childrenCount: \(self.children?.count ?? -1)" +
|
||||
">"
|
||||
"<ShortcutItem: \(title), " +
|
||||
"id: '\(self.identifier ?? "")', " +
|
||||
"isLeaf: \(self.isLeaf), " +
|
||||
"childrenCount: \(self.children?.count ?? -1)" +
|
||||
">"
|
||||
}
|
||||
|
||||
let item: NSMenuItem?
|
||||
@objc dynamic var children: [ShortcutItem]?
|
||||
|
||||
init(
|
||||
title: String,
|
||||
isLeaf: Bool,
|
||||
item: NSMenuItem?
|
||||
) {
|
||||
init(title: String, isLeaf: Bool, item: NSMenuItem?) {
|
||||
self.title = title
|
||||
self.isLeaf = isLeaf
|
||||
self.item = item
|
||||
|
@ -11,7 +11,7 @@ import ShortcutRecorder
|
||||
class ShortcutsPref: PrefPane,
|
||||
UiComponent,
|
||||
NSOutlineViewDelegate,
|
||||
SRRecorderControlDelegate {
|
||||
RecorderControlDelegate {
|
||||
|
||||
typealias StateType = AppState
|
||||
|
||||
@ -29,6 +29,20 @@ class ShortcutsPref: PrefPane,
|
||||
|
||||
super.init(frame: .zero)
|
||||
|
||||
if let version = self.shortcutsUserDefaults?.integer(forKey: "version"),
|
||||
version > defaultsVersion {
|
||||
let alert = NSAlert()
|
||||
alert.alertStyle = .warning
|
||||
alert.messageText = "Incompatible Defaults for Shortcuts"
|
||||
alert.informativeText = "The stored defaults for shortcuts are not compatible with "
|
||||
+ "this version of VimR. You can delete the stored defaults "
|
||||
+ "by executing 'defaults delete com.qvacua.VimR.menuitems' "
|
||||
+ "in Terminal."
|
||||
alert.runModal()
|
||||
return
|
||||
}
|
||||
|
||||
self.migrateDefaults()
|
||||
self.initShortcutUserDefaults()
|
||||
|
||||
self.addViews()
|
||||
@ -51,18 +65,43 @@ class ShortcutsPref: PrefPane,
|
||||
private let treeController = NSTreeController()
|
||||
private let shortcutItemsRoot = ShortcutItem(title: "root", isLeaf: false, item: nil)
|
||||
|
||||
private let keyEqTransformer = SRKeyEquivalentTransformer()
|
||||
private let keyEqModTransformer = SRKeyEquivalentModifierMaskTransformer()
|
||||
private let keyEqTransformer = DataToKeyEquivalentTransformer()
|
||||
private let keyEqModTransformer = DataToKeyEquivalentModifierMaskTransformer()
|
||||
|
||||
private let shortcutsUserDefaults = UserDefaults(suiteName: "com.qvacua.VimR.menuitems")
|
||||
private let shortcutsDefaultsController: NSUserDefaultsController
|
||||
|
||||
private func migrateDefaults() {
|
||||
if (self.shortcutsUserDefaults?.integer(forKey: defaultsVersionKey) ?? 0) == defaultsVersion {
|
||||
return
|
||||
}
|
||||
|
||||
legacyDefaultShortcuts.keys.forEach { id in
|
||||
let shortcut: Shortcut?
|
||||
if let dict = self.shortcutsUserDefaults?.value(forKey: id) as? [String: Any] {
|
||||
shortcut = Shortcut(dictionary: dict)
|
||||
} else {
|
||||
shortcut = defaultShortcuts[id] ?? nil
|
||||
}
|
||||
|
||||
let data = ValueTransformer
|
||||
.keyedUnarchiveFromDataTransformer
|
||||
.reverseTransformedValue(shortcut) as? NSData
|
||||
self.shortcutsUserDefaults?.set(data, forKey: id)
|
||||
}
|
||||
|
||||
self.shortcutsUserDefaults?.set(defaultsVersion, forKey: defaultsVersionKey)
|
||||
}
|
||||
|
||||
private func initShortcutUserDefaults() {
|
||||
defaultShortcuts.forEach { identifier, shortcutData in
|
||||
if self.shortcutsUserDefaults?.value(forKey: identifier) == nil {
|
||||
self.shortcutsUserDefaults?.set(shortcutData, forKey: identifier)
|
||||
let transformer = ValueTransformer(forName: .keyedUnarchiveFromDataTransformerName)!
|
||||
defaultShortcuts.forEach { id, shortcut in
|
||||
if self.shortcutsUserDefaults?.value(forKey: id) == nil {
|
||||
let shortcutData = transformer.reverseTransformedValue(shortcut) as? NSData
|
||||
self.shortcutsUserDefaults?.set(shortcutData, forKey: id)
|
||||
}
|
||||
}
|
||||
self.shortcutsUserDefaults?.set(defaultsVersion, forKey: defaultsVersionKey)
|
||||
}
|
||||
|
||||
private func initOutlineViewBindings() {
|
||||
@ -206,7 +245,7 @@ extension ShortcutsPref {
|
||||
guard response == .alertSecondButtonReturn else { return }
|
||||
self.traverseMenuItems { identifier, _ in
|
||||
self.shortcutsDefaultsController.setValue(
|
||||
defaultShortcuts[identifier],
|
||||
legacyDefaultShortcuts[identifier],
|
||||
forKeyPath: "values.\(identifier)"
|
||||
)
|
||||
}
|
||||
@ -260,10 +299,7 @@ extension ShortcutsPref {
|
||||
return cellView
|
||||
}
|
||||
|
||||
cellView.customized = !self.shortcutsAreEqual(
|
||||
self.shortcutsDefaultsController.value(forKeyPath: "values.\(identifier)"),
|
||||
defaultShortcuts[identifier]
|
||||
)
|
||||
cellView.customized = !self.areShortcutsEqual(identifier)
|
||||
cellView.layoutViews()
|
||||
cellView.setDelegateOfRecorder(self)
|
||||
cellView.bindRecorder(toKeyPath: "values.\(identifier)", to: self.shortcutsDefaultsController)
|
||||
@ -273,41 +309,50 @@ extension ShortcutsPref {
|
||||
|
||||
func outlineView(_: NSOutlineView, heightOfRowByItem item: Any) -> CGFloat { 28 }
|
||||
|
||||
private func shortcutsAreEqual(_ lhs: Any?, _ rhs: Any?) -> Bool {
|
||||
if lhs == nil && rhs == nil { return true }
|
||||
private func areShortcutsEqual(_ identifier: String) -> Bool {
|
||||
guard let dataFromDefaults = self.shortcutsDefaultsController.value(
|
||||
forKeyPath: "values.\(identifier)"
|
||||
) as? NSData else { return true }
|
||||
|
||||
guard let lhsShortcut = lhs as? [String: Any],
|
||||
let rhsShortcut = rhs as? [String: Any] else { return false }
|
||||
guard let shortcutFromDefaults = ValueTransformer
|
||||
.keyedUnarchiveFromDataTransformer
|
||||
.transformedValue(dataFromDefaults) as? Shortcut else { return true }
|
||||
|
||||
if lhsShortcut.isEmpty && rhsShortcut.isEmpty { return true }
|
||||
let defaultShortcut = defaultShortcuts[identifier] ?? nil
|
||||
|
||||
if lhsShortcut[SRShortcutCharacters] as? String
|
||||
!= rhsShortcut[SRShortcutCharacters] as? String {
|
||||
return false
|
||||
}
|
||||
|
||||
if lhsShortcut[SRShortcutCharactersIgnoringModifiers] as? String
|
||||
!= rhsShortcut[SRShortcutCharactersIgnoringModifiers] as? String {
|
||||
return false
|
||||
}
|
||||
|
||||
if lhsShortcut[SRShortcutKeyCode] as? Int != rhsShortcut[SRShortcutKeyCode] as? Int {
|
||||
return false
|
||||
}
|
||||
|
||||
if lhsShortcut[SRShortcutModifierFlagsKey] as? Int
|
||||
!= rhsShortcut[SRShortcutModifierFlagsKey] as? Int {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
return shortcutFromDefaults.isEqual(to: defaultShortcut) == true
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - SRRecorderControlDelegate
|
||||
extension ShortcutsPref {
|
||||
|
||||
func shortcutRecorderDidEndRecording(_ sender: SRRecorderControl!) {
|
||||
func recorderControlDidEndRecording(_ sender: RecorderControl) {
|
||||
self.treeController.rearrangeObjects()
|
||||
}
|
||||
}
|
||||
|
||||
private let defaultsVersionKey = "version"
|
||||
private let defaultsVersion = 337
|
||||
|
||||
private class DataToKeyEquivalentTransformer: ValueTransformer {
|
||||
|
||||
override func transformedValue(_ value: Any?) -> Any? {
|
||||
guard let shortcut = ValueTransformer
|
||||
.keyedUnarchiveFromDataTransformer
|
||||
.transformedValue(value) as? Shortcut else { return "" }
|
||||
|
||||
return KeyEquivalentTransformer.shared.transformedValue(shortcut)
|
||||
}
|
||||
}
|
||||
|
||||
private class DataToKeyEquivalentModifierMaskTransformer: ValueTransformer {
|
||||
|
||||
override func transformedValue(_ value: Any?) -> Any? {
|
||||
guard let shortcut = ValueTransformer
|
||||
.keyedUnarchiveFromDataTransformer
|
||||
.transformedValue(value) as? Shortcut else { return NSNumber(value: 0) }
|
||||
|
||||
return KeyEquivalentModifierMaskTransformer.shared.transformedValue(shortcut)
|
||||
}
|
||||
}
|
||||
|
@ -27,23 +27,21 @@ class ShortcutTableCell: NSTableCellView {
|
||||
var isDir = false
|
||||
|
||||
var text: String {
|
||||
get {
|
||||
return self.textField!.stringValue
|
||||
}
|
||||
|
||||
set {
|
||||
self.textField?.stringValue = newValue
|
||||
}
|
||||
get { self.textField!.stringValue }
|
||||
set { self.textField?.stringValue = newValue }
|
||||
}
|
||||
|
||||
func setDelegateOfRecorder(_ delegate: SRRecorderControlDelegate) {
|
||||
func setDelegateOfRecorder(_ delegate: RecorderControlDelegate) {
|
||||
self.shortcutRecorder.delegate = delegate
|
||||
}
|
||||
|
||||
func bindRecorder(toKeyPath keypath: String, to content: Any) {
|
||||
self.shortcutRecorder.unbind(.value)
|
||||
self.shortcutRecorder.bind(
|
||||
.value, to: content, withKeyPath: keypath
|
||||
.value,
|
||||
to: content,
|
||||
withKeyPath: keypath,
|
||||
options: [.valueTransformer: ValueTransformer.keyedUnarchiveFromDataTransformer]
|
||||
)
|
||||
}
|
||||
|
||||
@ -66,9 +64,8 @@ class ShortcutTableCell: NSTableCellView {
|
||||
let recorder = self.shortcutRecorder
|
||||
recorder.allowsEscapeToCancelRecording = true
|
||||
recorder.allowsDeleteToClearShortcutAndEndRecording = true
|
||||
recorder.storesEmptyValueForNoShortcut = true
|
||||
recorder.setAllowedModifierFlags(
|
||||
[.command, .shift, .option, .control],
|
||||
recorder.set(
|
||||
allowedModifierFlags: [.command, .shift, .option, .control],
|
||||
requiredModifierFlags: [],
|
||||
allowsEmptyModifierFlags: false
|
||||
)
|
||||
@ -117,11 +114,9 @@ class ShortcutTableCell: NSTableCellView {
|
||||
textField.autoPinEdge(toSuperviewEdge: .top, withInset: 3)
|
||||
}
|
||||
|
||||
private let shortcutRecorder = SRRecorderControl(forAutoLayout: ())
|
||||
private let shortcutRecorder = RecorderControl(forAutoLayout: ())
|
||||
private let _textField = NSTextField(forAutoLayout: ())
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") }
|
||||
}
|
||||
|
||||
|
@ -15,10 +15,10 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>SNAPSHOT-336</string>
|
||||
<string>0.31.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>336</string>
|
||||
<string>337</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
33
appcast.xml
33
appcast.xml
@ -7,37 +7,22 @@
|
||||
<description>Most recent changes with links to updates for VimR.</description>
|
||||
<language>en</language>
|
||||
<item>
|
||||
<title>v0.30.0-335</title>
|
||||
<title>v0.31.0-337</title>
|
||||
<description><![CDATA[
|
||||
<ul>
|
||||
<li>Improve Open Quickly<ul>
|
||||
<li>Use <a href="https://github.com/ggreer/the_silver_searcher">The Silver Searcher</a>'s ignore mechanism</li>
|
||||
<li>Use <a href="https://github.com/MaskRay/ccls">ccls</a>' fuzzy search</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>GH-730: Add "Close Window" menu item, which closes all tabs (and the VimR window).</li>
|
||||
<li>GH-768: Bugfix: coc.nvim does not work.</li>
|
||||
<li>Bugfix: VimR hangs when there are windows in which nvim is waiting for user input.</li>
|
||||
<li>Bugfix: Forward search in Markdown preview does not work.</li>
|
||||
<li>Bugfix: "Open Quickly" result rows are not dark mode compatible.</li>
|
||||
<li>Bugfix: Enter without selecting a result in the "Open Quickly" window results in a crash.</li>
|
||||
<li>Dependencies updates:<ul>
|
||||
<li>IBM-Swift/BlueSocket 1.0.52</li>
|
||||
<li>elegantchaos/DictionaryCoding 1.0.7</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Improve handling of file system changes for the file browser</li>
|
||||
</ul>
|
||||
]]></description>
|
||||
<releaseNotesLink>
|
||||
https://github.com/qvacua/vimr/releases/tag/v0.30.0-335
|
||||
https://github.com/qvacua/vimr/releases/tag/v0.31.0-337
|
||||
</releaseNotesLink>
|
||||
<pubDate>2020-01-24T23:40:24.018858</pubDate>
|
||||
<pubDate>2020-01-29T18:46:32.955903</pubDate>
|
||||
<minimumSystemVersion>10.12.0</minimumSystemVersion>
|
||||
<enclosure url="https://github.com/qvacua/vimr/releases/download/v0.30.0-335/VimR-v0.30.0-335.tar.bz2"
|
||||
sparkle:version="335"
|
||||
sparkle:shortVersionString="0.30.0"
|
||||
sparkle:dsaSignature="MCwCFBruv+r11RKh6fPQq1aP+bJoIabKAhRDGo9Q6NNCefyQnpsBhm44fKRJ3w=="
|
||||
length="14656304"
|
||||
<enclosure url="https://github.com/qvacua/vimr/releases/download/v0.31.0-337/VimR-v0.31.0-337.tar.bz2"
|
||||
sparkle:version="337"
|
||||
sparkle:shortVersionString="0.31.0"
|
||||
sparkle:dsaSignature="MCwCFGUJZ7akEbHT3JcZCICNswi8iJZdAhRofIjp5z72Del7RHv2hvJyZ9b7CQ=="
|
||||
length="14698478"
|
||||
type="application/octet-stream"/>
|
||||
</item>
|
||||
</channel>
|
||||
|
@ -7,23 +7,22 @@
|
||||
<description>Most recent changes with links to updates for VimR.</description>
|
||||
<language>en</language>
|
||||
<item>
|
||||
<title>SNAPSHOT-336</title>
|
||||
<title>v0.31.0-337</title>
|
||||
<description><![CDATA[
|
||||
<ul>
|
||||
<li><em>Note that SNAPSHOT builds are prone to be very unstable.</em></li>
|
||||
<li>Improve handling of file system changes for the file browser</li>
|
||||
</ul>
|
||||
]]></description>
|
||||
<releaseNotesLink>
|
||||
https://github.com/qvacua/vimr/releases/tag/snapshot/336
|
||||
https://github.com/qvacua/vimr/releases/tag/v0.31.0-337
|
||||
</releaseNotesLink>
|
||||
<pubDate>2020-01-26T22:17:08.186659</pubDate>
|
||||
<pubDate>2020-01-29T18:46:32.955903</pubDate>
|
||||
<minimumSystemVersion>10.12.0</minimumSystemVersion>
|
||||
<enclosure url="https://github.com/qvacua/vimr/releases/download/snapshot/336/VimR-SNAPSHOT-336.tar.bz2"
|
||||
sparkle:version="336"
|
||||
sparkle:shortVersionString="SNAPSHOT-336"
|
||||
sparkle:dsaSignature="MCwCFBcZO/2EKNKIme3I2mOMZ7m+BEmdAhRgZdHZ9L7GBbda0jbX0XcSu8OCwg=="
|
||||
length="14699218"
|
||||
<enclosure url="https://github.com/qvacua/vimr/releases/download/v0.31.0-337/VimR-v0.31.0-337.tar.bz2"
|
||||
sparkle:version="337"
|
||||
sparkle:shortVersionString="0.31.0"
|
||||
sparkle:dsaSignature="MCwCFGUJZ7akEbHT3JcZCICNswi8iJZdAhRofIjp5z72Del7RHv2hvJyZ9b7CQ=="
|
||||
length="14698478"
|
||||
type="application/octet-stream"/>
|
||||
</item>
|
||||
</channel>
|
||||
|
@ -1,5 +1,10 @@
|
||||
# Next
|
||||
|
||||
* Dependencies updates:
|
||||
- Kentzo/ShortcutRecorder 3.1
|
||||
|
||||
# 0.31.0-337
|
||||
|
||||
* Improve handling of file system changes for the file browser
|
||||
|
||||
# 0.30.0-335
|
||||
|
Loading…
Reference in New Issue
Block a user