Theme Editor: show/hide highlighted matches when showing/hiding "find bar"

This commit is contained in:
Karl Tauber
2020-12-31 15:55:22 +01:00
parent 3f202a7cdc
commit 1c08e98c1c

View File

@@ -72,6 +72,22 @@ class FlatFindReplaceBar
return findField.requestFocusInWindow();
}
@Override
public void addNotify() {
super.addNotify();
// if showing bar, highlight matches in editor
find();
}
@Override
public void removeNotify() {
super.removeNotify();
// if hiding bar, clear all highlighted matches in editor
SearchEngine.markAll( textArea, new SearchContext() );
}
private void findNext() {
context.setSearchForward( true );
find();