|
@@ -1525,9 +1525,19 @@ extension KMMainViewController {
|
|
|
}
|
|
|
|
|
|
func showInFinder(_ sender: Any) -> Void {
|
|
|
- let file: URL = (self.myDocument?.fileURL)!
|
|
|
- if FileManager.default.fileExists(atPath: file.path) {
|
|
|
- NSWorkspace.shared.activateFileViewerSelecting([file])
|
|
|
+ if sender is NSNotification {
|
|
|
+ let tabController = (sender as! NSNotification).object as? CTTabController
|
|
|
+ if tabController?.title == self.document?.documentURL.lastPathComponent {
|
|
|
+ let file: URL = (self.myDocument?.fileURL)!
|
|
|
+ if FileManager.default.fileExists(atPath: file.path) {
|
|
|
+ NSWorkspace.shared.activateFileViewerSelecting([file])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ let file: URL = (self.myDocument?.fileURL)!
|
|
|
+ if FileManager.default.fileExists(atPath: file.path) {
|
|
|
+ NSWorkspace.shared.activateFileViewerSelecting([file])
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|