-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Added functionality to close welcome screen when file is selected #424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
CodeEdit/AppDelegate.swift
Outdated
| } else { | ||
| CodeEditDocumentController.shared.openDocument { _, _ in | ||
| } | ||
| else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move the else statement to the previous line:
if ... {
...
} else {
…
}having it on a new line fails in SwiftLint
|
|
||
| extension NSDocumentController { | ||
| func openDocument(completionHandler: @escaping (NSDocument?, Bool) -> Void) { | ||
| func openDocument(completionHandler: @escaping (NSDocument?, Bool) -> Void, cancelHandler: @escaping () -> Void) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of
func openDocument(completionHandler: @escaping (NSDocument?, Bool) -> Void, cancelHandler: @escaping () -> Void) {}consider using a blank or onCompletion label for the first argument and onCancel for the second one.
func openDocument(_ completionHandler: @escaping (NSDocument?, Bool) -> Void, onCancel: @escaping () -> Void) {}|
Many thanks 👍 @lukepistrol |
|
@all-contributors please add @dzign1 for code |
|
I've put up a pull request to add @dzign1! 🎉 |
Description
Welcome screen now disappears when the 'Open a file or folder' is pressed. This is done by adding a cancel handler parameter to the openDocument function which calls the openWelcome function once cancel is pressed.
Related Issue
Checklist
Screenshots