1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-25 06:06:21 +03:00

Add small improvements

This commit is contained in:
Ezequiel Rosas 2017-07-03 12:40:13 -05:00
parent feb9395fd5
commit 1811d131a3

View File

@ -185,15 +185,15 @@ extension Workspace {
self.proxyBar.removeFromSuperview()
}
fileprivate func isFile(sender: NSDraggingInfo?) -> Bool! {
return (sender?.draggingPasteboard().types?.contains(String(kUTTypeFileURL)))!
fileprivate func isFile(sender: NSDraggingInfo?) -> Bool {
return (sender?.draggingPasteboard().types?.contains(String(kUTTypeFileURL))) ?? false
}
override func performDragOperation(_ sender: NSDraggingInfo) -> Bool {
if isFile(sender: sender) {
let paths = sender
.draggingPasteboard()
.propertyList(forType: "NSFilenamesPboardType") as? [String]
.propertyList(forType: NSFilenamesPboardType) as? [String]
self.open(filePaths: paths!)
return true;
}