diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e1326225..7a689fdee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Change Log ### Improvements +- Enable walking through all the controls in the Find window by the Tab key. - Update C++ syntax style to fix highlighting attributes (thanks to Luke McKenzie!). - Deprecate the Find Selected Text command. - [trivial] Reset custom key bindings for find commands were reset. diff --git a/CotEditor/Base.lproj/FindPanel.storyboard b/CotEditor/Base.lproj/FindPanel.storyboard index 1f8056e5b..3c7847ed9 100644 --- a/CotEditor/Base.lproj/FindPanel.storyboard +++ b/CotEditor/Base.lproj/FindPanel.storyboard @@ -10,7 +10,7 @@ - + @@ -88,7 +88,6 @@ - @@ -131,7 +130,6 @@ - @@ -206,7 +204,7 @@ - + @@ -230,7 +228,7 @@ - + @@ -274,7 +272,7 @@ - + @@ -290,7 +288,7 @@ - + diff --git a/CotEditor/Sources/FindPanelController.swift b/CotEditor/Sources/FindPanelController.swift index bed7671d5..a4a1977d4 100644 --- a/CotEditor/Sources/FindPanelController.swift +++ b/CotEditor/Sources/FindPanelController.swift @@ -47,7 +47,7 @@ final class FindPanelController: NSWindowController { // select text in find text field if self.window?.firstResponder == self.window?.initialFirstResponder { - // force reset firstResponder to invoke becomeFirstResponder in FindPanelTextView every time + // forcibly reset firstResponder to invoke becomeFirstResponder in FindPanelTextView every time // -> `becomeFirstResponder` will not be called on `makeFirstResponder:` if it given object is already set as first responder. self.window?.makeFirstResponder(nil) } diff --git a/CotEditor/Sources/FindPanelTextView.swift b/CotEditor/Sources/FindPanelTextView.swift index 91aea36f3..c4c6c7efa 100644 --- a/CotEditor/Sources/FindPanelTextView.swift +++ b/CotEditor/Sources/FindPanelTextView.swift @@ -119,27 +119,27 @@ class FindPanelTextView: NSTextView { } - /// jump to the next responder with tab key (standard NSTextField behavior) + /// jump to the next key view by the Tab key (standard NSTextField behavior) override func insertTab(_ sender: Any?) { - self.window?.makeFirstResponder(self.nextKeyView) + self.window?.selectNextKeyView(nil) } - /// jump to the previous responder with tab key (standard NSTextField behavior) + /// jump to the previous key view by the Tab key (standard NSTextField behavior) override func insertBacktab(_ sender: Any?) { - self.window?.makeFirstResponder(self.previousKeyView) + self.window?.selectPreviousKeyView(nil) } - /// swap '¥' with '\' if needed + /// swap `¥` with `\` if needed override func insertText(_ string: Any, replacementRange: NSRange) { // cast input to String var string = String(anyString: string) - // swap '¥' with '\' if needed + // swap `¥` with `\` if needed if UserDefaults.standard[.swapYenAndBackSlash] { switch string { case "\\": @@ -156,7 +156,7 @@ class FindPanelTextView: NSTextView { override func responds(to aSelector: Selector!) -> Bool { - // ignore text find action + // ignore text find action (standard NSTextField behavior) if aSelector == #selector(performTextFinderAction) { return false }