1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-26 15:25:14 +03:00

Handle --wait correctly when opening file

This commit is contained in:
Tae Won Ha 2018-07-01 16:34:41 +02:00
parent 5080ff9d1f
commit 785e669621
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
2 changed files with 4 additions and 4 deletions

View File

@ -15,7 +15,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
enum Action {
case newMainWindow(urls: [URL], cwd: URL, nvimArgs: [String]?, cliPipePath: String?)
case openInKeyWindow(urls: [URL], cwd: URL)
case openInKeyWindow(urls: [URL], cwd: URL, cliPipePath: String?)
case preferences
}
@ -261,7 +261,7 @@ extension AppDelegate {
self.emit(.newMainWindow(urls: urls, cwd: cwd, nvimArgs: nil, cliPipePath: pipePath))
case .open:
self.emit(.openInKeyWindow(urls: urls, cwd: cwd))
self.emit(.openInKeyWindow(urls: urls, cwd: cwd, cliPipePath: pipePath))
case .separateWindows:
urls.forEach { self.emit(.newMainWindow(urls: [$0], cwd: cwd, nvimArgs: nil, cliPipePath: pipePath)) }

View File

@ -28,9 +28,9 @@ class AppDelegateReducer {
state.mainWindows[mainWindow.uuid] = mainWindow
case let .openInKeyWindow(urls, cwd):
case let .openInKeyWindow(urls, cwd, cliPipePath):
guard let uuid = state.currentMainWindowUuid, state.mainWindows[uuid] != nil else {
let mainWindow = self.newMainWindow(with: state, urls: urls, cwd: cwd)
let mainWindow = self.newMainWindow(with: state, urls: urls, cwd: cwd, cliPipePath: cliPipePath)
state.mainWindows[mainWindow.uuid] = mainWindow
break
}