From 8b3b109a85729e22358f059915db0c46579a6eca Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Sun, 11 Sep 2016 21:23:48 +0200 Subject: [PATCH 1/4] Set snapshot version: 0.9.0-SNAPSHOT-20160911.2123-73 --- SwiftNeoVim/Info.plist | 4 ++-- SwiftNeoVimTests/Info.plist | 4 ++-- VimR.xcodeproj/project.pbxproj | 8 ++++---- VimR/Info.plist | 4 ++-- VimRTests/Info.plist | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/SwiftNeoVim/Info.plist b/SwiftNeoVim/Info.plist index 093eec85..f268d1f7 100644 --- a/SwiftNeoVim/Info.plist +++ b/SwiftNeoVim/Info.plist @@ -15,11 +15,11 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.9.0-SNAPSHOT-20160911.1535 + 0.9.0-SNAPSHOT-20160911.2123 CFBundleSignature ???? CFBundleVersion - 72 + 73 NSHumanReadableCopyright Copyright © 2016 Tae Won Ha. All rights reserved. NSPrincipalClass diff --git a/SwiftNeoVimTests/Info.plist b/SwiftNeoVimTests/Info.plist index 5b275e3a..148932ca 100644 --- a/SwiftNeoVimTests/Info.plist +++ b/SwiftNeoVimTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 0.9.0-SNAPSHOT-20160911.1535 + 0.9.0-SNAPSHOT-20160911.2123 CFBundleSignature ???? CFBundleVersion - 72 + 73 diff --git a/VimR.xcodeproj/project.pbxproj b/VimR.xcodeproj/project.pbxproj index 46137f0d..2802c42a 100644 --- a/VimR.xcodeproj/project.pbxproj +++ b/VimR.xcodeproj/project.pbxproj @@ -1002,7 +1002,7 @@ COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 72; + DYLIB_CURRENT_VERSION = 73; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -1026,7 +1026,7 @@ COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 72; + DYLIB_CURRENT_VERSION = 73; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -1141,7 +1141,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 72; + CURRENT_PROJECT_VERSION = 73; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -1188,7 +1188,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 72; + CURRENT_PROJECT_VERSION = 73; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; diff --git a/VimR/Info.plist b/VimR/Info.plist index 438dcb9c..bdd1562c 100644 --- a/VimR/Info.plist +++ b/VimR/Info.plist @@ -32,7 +32,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.0-SNAPSHOT-20160911.1535 + 0.9.0-SNAPSHOT-20160911.2123 CFBundleSignature ???? CFBundleURLTypes @@ -49,7 +49,7 @@ CFBundleVersion - 72 + 73 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright diff --git a/VimRTests/Info.plist b/VimRTests/Info.plist index 5b275e3a..148932ca 100644 --- a/VimRTests/Info.plist +++ b/VimRTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 0.9.0-SNAPSHOT-20160911.1535 + 0.9.0-SNAPSHOT-20160911.2123 CFBundleSignature ???? CFBundleVersion - 72 + 73 From d6a09d2ae65e0a2a2b4b495203ad8ba7e8ca2bf8 Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Tue, 13 Sep 2016 08:32:58 +0200 Subject: [PATCH 2/4] Store ignore patterns when end-of-editing and closing the window --- VimR/AppKitCommons.swift | 5 ++++- VimR/AppearancePrefPane.swift | 7 +++++-- VimR/GeneralPrefPane.swift | 27 ++++++++++++++------------- VimR/PrefPane.swift | 4 ++++ VimR/PrefWindowComponent.swift | 8 +++++++- 5 files changed, 34 insertions(+), 17 deletions(-) diff --git a/VimR/AppKitCommons.swift b/VimR/AppKitCommons.swift index 7953bb25..20d5d94f 100644 --- a/VimR/AppKitCommons.swift +++ b/VimR/AppKitCommons.swift @@ -48,7 +48,10 @@ extension NSTableView { static func standardTableView() -> NSTableView { let tableView = NSTableView(frame: CGRect.zero) - tableView.addTableColumn(NSTableColumn(identifier: "name")) + let column = NSTableColumn(identifier: "name") + column.editable = false + + tableView.addTableColumn(column) tableView.rowSizeStyle = .Default tableView.sizeLastColumnToFit() tableView.allowsEmptySelection = false diff --git a/VimR/AppearancePrefPane.swift b/VimR/AppearancePrefPane.swift index 4f634834..6df89193 100644 --- a/VimR/AppearancePrefPane.swift +++ b/VimR/AppearancePrefPane.swift @@ -22,7 +22,11 @@ class AppearancePrefPane: PrefPane, NSComboBoxDelegate, NSControlTextEditingDele return true } - private var data: AppearancePrefData + private var data: AppearancePrefData { + didSet { + self.updateViews(newData: self.data) + } + } private let fontManager = NSFontManager.sharedFontManager() @@ -62,7 +66,6 @@ class AppearancePrefPane: PrefPane, NSComboBoxDelegate, NSControlTextEditingDele .map { ($0 as! PrefData).appearance } .filter { [unowned self] data in data != self.data } .subscribeNext { [unowned self] data in - self.updateViews(newData: data) self.data = data } } diff --git a/VimR/GeneralPrefPane.swift b/VimR/GeneralPrefPane.swift index 76fcb392..cee102dd 100644 --- a/VimR/GeneralPrefPane.swift +++ b/VimR/GeneralPrefPane.swift @@ -20,7 +20,7 @@ func == (left: GeneralPrefData, right: GeneralPrefData) -> Bool { && left.ignorePatterns == right.ignorePatterns } -class GeneralPrefPane: PrefPane { +class GeneralPrefPane: PrefPane, NSTextFieldDelegate { override var pinToContainer: Bool { return true @@ -37,7 +37,6 @@ class GeneralPrefPane: PrefPane { super.init(source: source) self.updateViews(newData: initialData) - self.addReactions() } required init?(coder: NSCoder) { @@ -60,6 +59,10 @@ class GeneralPrefPane: PrefPane { let ignoreListTitle = self.titleTextField(title: "Files To Ignore:") let ignoreField = self.ignoreField + NSNotificationCenter.defaultCenter() + .addObserverForName(NSControlTextDidEndEditingNotification, object: ignoreField, queue: nil) { [unowned self] _ in + self.ignorePatternsAction() + } let ignoreInfo = self.infoTextField(text: "") ignoreInfo.attributedStringValue = self.ignoreInfoText() @@ -142,16 +145,8 @@ class GeneralPrefPane: PrefPane { } } - private func addReactions() { - self.ignoreField.rx_text - .skip(1) // To skip the event when the field gets created and is not yet initialized. - .throttle(0.2, scheduler: MainScheduler.instance) - .distinctUntilChanged() - .flatMapLatest { Observable.just(PrefUtils.ignorePatterns(fromString: $0)) } - .subscribeNext { [unowned self] patterns in - self.ignorePatternsAction(patterns) - } - .addDisposableTo(self.disposeBag) + override func windowWillClose() { + self.ignorePatternsAction() } private func set(data data: GeneralPrefData) { @@ -237,7 +232,12 @@ extension GeneralPrefPane { ) } - private func ignorePatternsAction(patterns: Set) { + private func ignorePatternsAction() { + let patterns = PrefUtils.ignorePatterns(fromString: self.ignoreField.stringValue) + if patterns == self.data.ignorePatterns { + return + } + self.set(data: GeneralPrefData( openNewWindowWhenLaunching: self.data.openNewWindowWhenLaunching, openNewWindowOnReactivation: self.data.openNewWindowOnReactivation, @@ -253,3 +253,4 @@ extension GeneralPrefPane { alert.runModal() } } + diff --git a/VimR/PrefPane.swift b/VimR/PrefPane.swift index b81e5561..177b8057 100644 --- a/VimR/PrefPane.swift +++ b/VimR/PrefPane.swift @@ -55,6 +55,10 @@ class PrefPane: NSView, Component { func publish(event event: Any) { self.subject.onNext(event) } + + func windowWillClose() { + + } } // MARK: - Control Utils diff --git a/VimR/PrefWindowComponent.swift b/VimR/PrefWindowComponent.swift index 654263ad..c6325f15 100644 --- a/VimR/PrefWindowComponent.swift +++ b/VimR/PrefWindowComponent.swift @@ -12,7 +12,7 @@ struct PrefData { var appearance: AppearancePrefData } -class PrefWindowComponent: WindowComponent, NSTableViewDataSource, NSTableViewDelegate { +class PrefWindowComponent: WindowComponent, NSWindowDelegate, NSTableViewDataSource, NSTableViewDelegate { private var data: PrefData @@ -48,6 +48,8 @@ class PrefWindowComponent: WindowComponent, NSTableViewDataSource, NSTableViewDe super.init(source: source, nibName: "PrefWindow") + self.window.delegate = self + self.addReactions() } @@ -117,6 +119,10 @@ class PrefWindowComponent: WindowComponent, NSTableViewDataSource, NSTableViewDe .subscribeNext { [unowned self] action in self.publish(event: action) } .addDisposableTo(self.disposeBag) } + + func windowWillClose(notification: NSNotification) { + self.panes.forEach { $0.windowWillClose() } + } } // MARK: - NSTableViewDataSource From b7348495f7b6ffeb1e7c5cc4fe01082089e16782 Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Wed, 14 Sep 2016 23:02:48 +0200 Subject: [PATCH 3/4] Set snapshot version: 0.9.0-SNAPSHOT-20160914.2302-74 --- SwiftNeoVim/Info.plist | 4 ++-- SwiftNeoVimTests/Info.plist | 4 ++-- VimR.xcodeproj/project.pbxproj | 8 ++++---- VimR/Info.plist | 4 ++-- VimRTests/Info.plist | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/SwiftNeoVim/Info.plist b/SwiftNeoVim/Info.plist index f268d1f7..c3c2e4f7 100644 --- a/SwiftNeoVim/Info.plist +++ b/SwiftNeoVim/Info.plist @@ -15,11 +15,11 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.9.0-SNAPSHOT-20160911.2123 + 0.9.0-SNAPSHOT-20160914.2302 CFBundleSignature ???? CFBundleVersion - 73 + 74 NSHumanReadableCopyright Copyright © 2016 Tae Won Ha. All rights reserved. NSPrincipalClass diff --git a/SwiftNeoVimTests/Info.plist b/SwiftNeoVimTests/Info.plist index 148932ca..769b8ee4 100644 --- a/SwiftNeoVimTests/Info.plist +++ b/SwiftNeoVimTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 0.9.0-SNAPSHOT-20160911.2123 + 0.9.0-SNAPSHOT-20160914.2302 CFBundleSignature ???? CFBundleVersion - 73 + 74 diff --git a/VimR.xcodeproj/project.pbxproj b/VimR.xcodeproj/project.pbxproj index 2802c42a..5e69a623 100644 --- a/VimR.xcodeproj/project.pbxproj +++ b/VimR.xcodeproj/project.pbxproj @@ -1002,7 +1002,7 @@ COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 73; + DYLIB_CURRENT_VERSION = 74; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -1026,7 +1026,7 @@ COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 73; + DYLIB_CURRENT_VERSION = 74; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -1141,7 +1141,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 73; + CURRENT_PROJECT_VERSION = 74; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -1188,7 +1188,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 73; + CURRENT_PROJECT_VERSION = 74; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; diff --git a/VimR/Info.plist b/VimR/Info.plist index bdd1562c..e51deb31 100644 --- a/VimR/Info.plist +++ b/VimR/Info.plist @@ -32,7 +32,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.0-SNAPSHOT-20160911.2123 + 0.9.0-SNAPSHOT-20160914.2302 CFBundleSignature ???? CFBundleURLTypes @@ -49,7 +49,7 @@ CFBundleVersion - 73 + 74 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright diff --git a/VimRTests/Info.plist b/VimRTests/Info.plist index 148932ca..769b8ee4 100644 --- a/VimRTests/Info.plist +++ b/VimRTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 0.9.0-SNAPSHOT-20160911.2123 + 0.9.0-SNAPSHOT-20160914.2302 CFBundleSignature ???? CFBundleVersion - 73 + 74 From 2ee4ef2318a0468ff9613c60ab7c894eae3d89fd Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Thu, 15 Sep 2016 21:56:17 +0200 Subject: [PATCH 4/4] Update neovim --- neovim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neovim b/neovim index 8af31413..6ff44253 160000 --- a/neovim +++ b/neovim @@ -1 +1 @@ -Subproject commit 8af314133e2056683c95b88e8dca135ed23303fc +Subproject commit 6ff44253457a9044c6b42304a032cbeac833fc43