From ae9cddf0aca6cf9c7b16b0b17f32c613120e2c2d Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Sat, 13 Aug 2016 23:02:00 +0200 Subject: [PATCH] GH-244 Add stub applicationOpenUntitledFile() --- VimR/AppDelegate.swift | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/VimR/AppDelegate.swift b/VimR/AppDelegate.swift index d2c0ba6e..7ae77ace 100644 --- a/VimR/AppDelegate.swift +++ b/VimR/AppDelegate.swift @@ -26,6 +26,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { private let prefWindowComponent: PrefWindowComponent private var quitWhenAllWindowsAreClosed = false + private var launching = true override init() { self.actionSink = self.actionSubject.asObservable() @@ -66,16 +67,26 @@ class AppDelegate: NSObject, NSApplicationDelegate { // MARK: - NSApplicationDelegate extension AppDelegate { - func applicationDidFinishLaunching(aNotification: NSNotification) { + func applicationWillFinishLaunching(_: NSNotification) { + self.launching = true + } + + func applicationDidFinishLaunching(_: NSNotification) { // let testView = InputTestView(frame: CGRect(x: 0, y: 0, width: 300, height: 300)) // self.window.contentView?.addSubview(testView) // self.window.makeFirstResponder(testView) + + self.launching = false #if DEBUG self.debugMenu.hidden = false #endif + } + func applicationOpenUntitledFile(sender: NSApplication) -> Bool { self.newDocument(self) + NSLog("\(#function)") + return true } func applicationShouldTerminate(sender: NSApplication) -> NSApplicationTerminateReply {