|
@@ -2495,7 +2495,8 @@ extension KMMainViewController {
|
|
|
func showInFinder(_ sender: Any) -> Void {
|
|
|
if sender is NSNotification {
|
|
|
let tabController = (sender as! NSNotification).object as? CTTabController
|
|
|
- if tabController?.title == self.document?.documentURL.deletingPathExtension().lastPathComponent {
|
|
|
+ let path = self.document?.documentURL.deletingPathExtension().lastPathComponent
|
|
|
+ if tabController?.title == path {
|
|
|
if let file = self.myDocument?.fileURL {
|
|
|
if FileManager.default.fileExists(atPath: file.path) {
|
|
|
NSWorkspace.shared.activateFileViewerSelecting([file])
|
|
@@ -2523,13 +2524,23 @@ extension KMMainViewController {
|
|
|
|
|
|
func closeTab(_ sender: NSNotification) -> Void {
|
|
|
let tabController = sender.object as? CTTabController
|
|
|
- if tabController?.title == self.document?.documentURL.lastPathComponent {
|
|
|
+ let path = self.document?.documentURL.deletingPathExtension().lastPathComponent
|
|
|
+ if tabController?.title == path {
|
|
|
print("closeTab")
|
|
|
self.leftSideViewController.clearAnnotationFilterData()
|
|
|
self.leftSideViewController.clearNotification()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ func willCloseTab (_ sender: NSNotification) -> Void {
|
|
|
+ let tabController = sender.object as? CTTabController
|
|
|
+ let path = self.document?.documentURL.deletingPathExtension().lastPathComponent
|
|
|
+ if tabController?.title == path {
|
|
|
+ print("closeTab")
|
|
|
+ self.listView.clearScrollCache()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@IBAction func toggleSplitPDF(_ sender: Any) {
|
|
|
if let menuItem = sender as? NSMenuItem {
|
|
|
splitView(withTag: menuItem.tag)
|