Focus target document when clicking find result table row

This commit is contained in:
1024jp 2022-12-22 20:59:47 +09:00
parent ab310211be
commit f77df903ed
2 changed files with 3 additions and 1 deletions

View File

@ -13,6 +13,7 @@ Change Log
- Update the Unicode block name list for the character inspector from Unicode 14.0.0 to Unicode 15.0.0.
- Deprecate the option to keep the progress dialog for find/replacement after finishing the task.
- Deprecate the option not to select the next match after the replacement when clicking the Replace button.
- [trivial] Make the target document the key window when selecting a matched line in the find result view.
- [trivial] Tweak the style of headings in menus.
- [trivial] Tweak the setting summary display in the print dialog.
- [dev] Migrate the most of sheets and popovers to SwiftUI.

View File

@ -149,8 +149,8 @@ final class FindPanelResultViewController: NSViewController, NSTableViewDataSour
self.findString = findString
self.results = results
let documentName = (target.window?.windowController?.document as? NSDocument)?.displayName ?? "Unknown" // This should never be nil.
let resultMessage: String = {
let documentName = (target.window?.windowController?.document as? NSDocument)?.displayName ?? "Unknown" // This should never be nil.
switch results.count {
case 0:
return String(localized: "No strings found in “\(documentName).”")
@ -190,6 +190,7 @@ final class FindPanelResultViewController: NSViewController, NSTableViewDataSour
else { return }
textView.select(range: range)
textView.window?.makeKeyAndOrderFront(nil)
}
}