diff --git a/NvimView/NvimView.xcodeproj/project.pbxproj b/NvimView/NvimView.xcodeproj/project.pbxproj
index b47033ba..8cd682da 100644
--- a/NvimView/NvimView.xcodeproj/project.pbxproj
+++ b/NvimView/NvimView.xcodeproj/project.pbxproj
@@ -466,7 +466,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 280;
+ CURRENT_PROJECT_VERSION = 281;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
@@ -526,7 +526,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 280;
+ CURRENT_PROJECT_VERSION = 281;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -553,7 +553,7 @@
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 280;
+ DYLIB_CURRENT_VERSION = 281;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../Carthage/Build/Mac";
FRAMEWORK_VERSION = A;
@@ -575,7 +575,7 @@
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 280;
+ DYLIB_CURRENT_VERSION = 281;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../Carthage/Build/Mac";
FRAMEWORK_VERSION = A;
diff --git a/NvimView/NvimView/Info.plist b/NvimView/NvimView/Info.plist
index bd142e9e..83755b91 100644
--- a/NvimView/NvimView/Info.plist
+++ b/NvimView/NvimView/Info.plist
@@ -15,9 +15,9 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- SNAPSHOT-280
+ SNAPSHOT-281
CFBundleVersion
- 280
+ 281
NSHumanReadableCopyright
Copyright © 2017 Tae Won Ha. All rights reserved.
NSPrincipalClass
diff --git a/VimR/VimR.xcodeproj/project.pbxproj b/VimR/VimR.xcodeproj/project.pbxproj
index 4c75cb90..9f8f3bba 100644
--- a/VimR/VimR.xcodeproj/project.pbxproj
+++ b/VimR/VimR.xcodeproj/project.pbxproj
@@ -1224,7 +1224,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 280;
+ CURRENT_PROJECT_VERSION = 281;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
@@ -1281,7 +1281,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 280;
+ CURRENT_PROJECT_VERSION = 281;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
diff --git a/VimR/VimR/AppDelegate.swift b/VimR/VimR/AppDelegate.swift
index 67ebf78c..8d997eb1 100644
--- a/VimR/VimR/AppDelegate.swift
+++ b/VimR/VimR/AppDelegate.swift
@@ -64,6 +64,10 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
self.useSnapshot = appState.useSnapshotUpdate
self.setSparkleUrl(self.useSnapshot)
}
+
+ if appState.quit {
+ NSApp.terminate(self)
+ }
})
.disposed(by: self.disposeBag)
diff --git a/VimR/VimR/Context.swift b/VimR/VimR/Context.swift
index b9032b20..f7e0e3fe 100644
--- a/VimR/VimR/Context.swift
+++ b/VimR/VimR/Context.swift
@@ -25,6 +25,7 @@ class Context {
let previewService = PreviewService()
let httpService: HttpServerService = HttpServerService(port: baseServerUrl.port!)
+ let uiRootReducer = UiRootReducer()
// AppState
Observable
@@ -33,7 +34,7 @@ class Context {
.reduce(by: AppDelegateReducer(baseServerUrl: baseServerUrl).reduce)
.filterMapPair(),
self.actionSourceForAppState()
- .reduce(by: UiRootReducer().reduce)
+ .reduce(by: uiRootReducer.reduceMainWindow)
.reduce(by: openQuicklyReducer.reduceMainWindow)
.filter { $0.modified }
.apply(self.prefService.applyMainWindow)
@@ -43,6 +44,9 @@ class Context {
.filterMapPair(),
self.actionSourceForAppState()
.reduce(by: openQuicklyReducer.reduceOpenQuicklyWindow)
+ .filterMapPair(),
+ self.actionSourceForAppState()
+ .reduce(by: uiRootReducer.reduceUiRoot)
.filterMapPair()
)
.merge()
diff --git a/VimR/VimR/Info.plist b/VimR/VimR/Info.plist
index 1f01bb1c..3acaac3a 100644
--- a/VimR/VimR/Info.plist
+++ b/VimR/VimR/Info.plist
@@ -1224,7 +1224,7 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
- SNAPSHOT-280
+ SNAPSHOT-281
CFBundleSignature
????
CFBundleURLTypes
@@ -1241,7 +1241,7 @@
CFBundleVersion
- 280
+ 281
LSApplicationCategoryType
public.app-category.productivity
LSMinimumSystemVersion
diff --git a/VimR/VimR/States.swift b/VimR/VimR/States.swift
index c07080b1..adf5ef9d 100644
--- a/VimR/VimR/States.swift
+++ b/VimR/VimR/States.swift
@@ -33,6 +33,8 @@ struct AppState: SerializableState {
var openQuickly = OpenQuicklyWindow.State.default
+ var quit = false
+
init() {
}
diff --git a/VimR/VimR/UiRoot.swift b/VimR/VimR/UiRoot.swift
index 0d246675..3cf53e23 100644
--- a/VimR/VimR/UiRoot.swift
+++ b/VimR/VimR/UiRoot.swift
@@ -10,9 +10,15 @@ class UiRoot: UiComponent {
typealias StateType = AppState
+ enum Action {
+
+ case quit
+ }
+
required init(source: Observable, emitter: ActionEmitter, state: StateType) {
self.source = source
self.emitter = emitter
+ self.emit = emitter.typedEmit()
self.fileMonitor = FileMonitor(source: source, emitter: emitter, state: state)
self.openQuicklyWindow = OpenQuicklyWindow(source: source, emitter: emitter, state: state)
@@ -50,7 +56,7 @@ class UiRoot: UiComponent {
case .doNothing: return
case .hide: NSApp.hide(self)
- case .quit: NSApp.terminate(self)
+ case .quit: self.emit(.quit)
}
})
@@ -66,6 +72,7 @@ class UiRoot: UiComponent {
private let source: Observable
private let emitter: ActionEmitter
+ private let emit: (Action) -> Void
private let disposeBag = DisposeBag()
private let fileMonitor: FileMonitor
diff --git a/VimR/VimR/UiRootReducer.swift b/VimR/VimR/UiRootReducer.swift
index a0e2b898..94d6e8f9 100644
--- a/VimR/VimR/UiRootReducer.swift
+++ b/VimR/VimR/UiRootReducer.swift
@@ -7,9 +7,23 @@ import Foundation
class UiRootReducer {
- typealias Pair = StateActionPair>
+ typealias UiRootPair = StateActionPair
+ typealias MainWindowPair = StateActionPair>
- func reduce(_ pair: Pair) -> Pair {
+ func reduceUiRoot(_ pair: UiRootPair) -> UiRootPair {
+ var appState = pair.state
+
+ switch pair.action {
+
+ case .quit:
+ appState.quit = true
+
+ }
+
+ return StateActionPair(state: appState, action: pair.action)
+ }
+
+ func reduceMainWindow(_ pair: MainWindowPair) -> MainWindowPair {
var appState = pair.state
let uuid = pair.action.uuid
diff --git a/VimR/VimRTests/Info.plist b/VimR/VimRTests/Info.plist
index e96b0f2f..91936612 100644
--- a/VimR/VimRTests/Info.plist
+++ b/VimR/VimRTests/Info.plist
@@ -15,10 +15,10 @@
CFBundlePackageType
BNDL
CFBundleShortVersionString
- SNAPSHOT-280
+ SNAPSHOT-281
CFBundleSignature
????
CFBundleVersion
- 280
+ 281
diff --git a/appcast_snapshot.xml b/appcast_snapshot.xml
index 4857f1d2..5c2dc343 100644
--- a/appcast_snapshot.xml
+++ b/appcast_snapshot.xml
@@ -7,27 +7,22 @@
Most recent changes with links to updates for VimR.
en
-
- SNAPSHOT-280
+ SNAPSHOT-281
-Neovim 0.3.0 🙂
-Dependencies updates:
-- Quick/nimble@7.1.2
-- eonil/FileSystemEvents@1.0.0
-
-
+GH-653: Bugfix: Crashes when closing the last window with "Quit after last window closes"-option turned on.
]]>
- https://github.com/qvacua/vimr/releases/tag/snapshot/280
+ https://github.com/qvacua/vimr/releases/tag/snapshot/281
- 2018-06-12T21:19:48.303228
+ 2018-07-01T11:18:57.837523
10.10.0
-
diff --git a/resources/release-notes.md b/resources/release-notes.md
index e5265b85..918a3312 100644
--- a/resources/release-notes.md
+++ b/resources/release-notes.md
@@ -2,8 +2,9 @@
* Neovim 0.3.0
* Some refactorings for the Neovim and the UI interface.
-* GH-636: Bugfix: double cursor when entering terminal
* GH-402: Add file associations; using definitions and icons from [MacVim](http://macvim.org/)
+* GH-636: Bugfix: double cursor when entering terminal
+* GH-653: Bugfix: Crashes when closing the last window with "Quit after last window closes"-option turned on.
* Use LuaJIT again.
* Dependencies updates:
- sparkle-project/Sparkle@1.19.0