mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Fix timing to update find string
This commit is contained in:
parent
9063356f12
commit
3bf7dad268
@ -23,6 +23,7 @@ develop
|
||||
- Fix an issue where the baseline of invisible characters were wrong by some fonts.
|
||||
- Fix an issue where application could crash after modifying theme name on El Capitan.
|
||||
- Fix an issue where submenu disclosure arrows in the menu key binding editor did occasionally disappear.
|
||||
- Fix timing to update search string to system-wide shared find string.
|
||||
- Fix an issue under the specific conditions where the migration window showed up every time on launch.
|
||||
|
||||
|
||||
|
@ -59,6 +59,7 @@
|
||||
<li>Fix an issue where the baseline of invisible characters were wrong by some fonts.</li>
|
||||
<li>Fix an issue where application could crash after modifying theme name on El Capitan.</li>
|
||||
<li>Fix an issue where submenu disclosure arrows in the menu key binding editor did occasionally disappear.</li>
|
||||
<li>Fix timing to update search string to system-wide shared find string.</li>
|
||||
<li>Fix an issue under the specific conditions where the migration window showed up every time on launch.</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
@ -60,6 +60,7 @@
|
||||
<li>設定フォントによっては、不可視文字のベースラインが誤って描画されることがあった不具合を修正</li>
|
||||
<li>El Capitan でテーマ名を編集した時にアプリケーションがクラッシュすることがあった不具合を修正</li>
|
||||
<li>メニューキーバインド設定のサブメニューの展開矢印が表示されないことがあった不具合を修正</li>
|
||||
<li>システム共有の検索文字列を取り込むタイミングを修正</li>
|
||||
<li>まれに移行ウインドウが毎回されることがあった不具合を修正</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
@ -115,6 +115,12 @@ static NSString *_Nonnull const kEscapeCharacter = @"\\";
|
||||
forKeyPath:CEDefaultFindNextAfterReplaceKey
|
||||
options:NSKeyValueObservingOptionNew
|
||||
context:NULL];
|
||||
|
||||
// observe application activation
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(applicationDidBecomeActive:)
|
||||
name:NSApplicationDidBecomeActiveNotification
|
||||
object:nil];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@ -126,6 +132,7 @@ static NSString *_Nonnull const kEscapeCharacter = @"\\";
|
||||
// ------------------------------------------------------
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] removeObserver:self forKeyPath:CEDefaultFindNextAfterReplaceKey];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
|
||||
[_splitView setDelegate:nil]; // NSSplitView's delegate is assign, not weak
|
||||
}
|
||||
@ -320,6 +327,19 @@ static NSString *_Nonnull const kEscapeCharacter = @"\\";
|
||||
}
|
||||
|
||||
|
||||
#pragma mark Notification
|
||||
|
||||
// ------------------------------------------------------
|
||||
/// sync search string on activating application
|
||||
- (void)applicationDidBecomeActive:(nonnull NSNotification *)notification
|
||||
// ------------------------------------------------------
|
||||
{
|
||||
if ([[NSUserDefaults standardUserDefaults] boolForKey:CEDefaultSyncFindPboardKey]) {
|
||||
[self setFindString:[self findStringFromPasteboard]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#pragma mark Public Action Messages
|
||||
|
||||
@ -333,13 +353,6 @@ static NSString *_Nonnull const kEscapeCharacter = @"\\";
|
||||
[self setResultShown:NO animate:NO];
|
||||
}
|
||||
|
||||
// sync search string
|
||||
if (![[self findPanel] isVisible] &&
|
||||
[[NSUserDefaults standardUserDefaults] boolForKey:CEDefaultSyncFindPboardKey])
|
||||
{
|
||||
[self setFindString:[self findStringFromPasteboard]];
|
||||
}
|
||||
|
||||
// select text in find text field
|
||||
if ([[self findPanel] firstResponder] == [[self findPanel] initialFirstResponder]) {
|
||||
// force reset firstResponder to invoke becomeFirstResponder in CEFindPanelTextView every time
|
||||
|
Loading…
Reference in New Issue
Block a user