mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Fix find string sync
This commit is contained in:
parent
48168a992d
commit
5094b788a1
@ -19,6 +19,7 @@ develop
|
||||
### Fixes
|
||||
|
||||
- Fix an issue where the application could crash after lossy encoding change.
|
||||
- Fix an issue where the find string was not synchronized with other applications.
|
||||
- Fix an issue where incompatible characters highlight could highlight wrong characters if line endings are CR/LF.
|
||||
- Fix an issue the menu item “About Scripting” in Help > “CotEditor Scripting Manual” didn't work.
|
||||
- Fix an issue where the zoomed character in the character inspector was flipped when the popover is detached.
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
© 2015-2016 1024jp
|
||||
© 2015-2017 1024jp
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@ -89,7 +89,14 @@ final class TextFinder: NSResponder, TextFinderSettingsProvider {
|
||||
|
||||
// MARK: Public Properties
|
||||
|
||||
dynamic var findString = ""
|
||||
dynamic var findString = "" {
|
||||
|
||||
didSet {
|
||||
if self.sharesFindString {
|
||||
NSPasteboard.findString = self.findString
|
||||
}
|
||||
}
|
||||
}
|
||||
dynamic var replacementString = ""
|
||||
|
||||
weak var delegate: TextFinderDelegate?
|
||||
@ -125,8 +132,6 @@ final class TextFinder: NSResponder, TextFinderSettingsProvider {
|
||||
|
||||
// observe application activation to sync find string with other apps
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(applicationDidBecomeActive), name: .NSApplicationDidBecomeActive, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(applicationWillResignActive), name: .NSApplicationWillResignActive, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(applicationWillResignActive), name: .NSApplicationWillTerminate, object: nil)
|
||||
}
|
||||
|
||||
|
||||
@ -186,15 +191,6 @@ final class TextFinder: NSResponder, TextFinderSettingsProvider {
|
||||
}
|
||||
|
||||
|
||||
/// sync search string on deactivating application
|
||||
func applicationWillResignActive(_ notification: Notification) {
|
||||
|
||||
if self.sharesFindString {
|
||||
NSPasteboard.findString = self.findString
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// MARK: Action Messages
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user