Theme Editor:

- change border color of find field to red if noting found/matches
- update search match highlighting after reloading file on external change
This commit is contained in:
Karl Tauber
2021-08-27 22:53:04 +02:00
parent a6d318a197
commit 968e508bb5
2 changed files with 6 additions and 1 deletions

View File

@@ -133,7 +133,7 @@ class FlatFindReplaceBar
findOrMarkAll( true );
}
private void markAll() {
void markAll() {
findOrMarkAll( false );
}
@@ -227,6 +227,8 @@ class FlatFindReplaceBar
private void updateMatchesLabel( SearchResult result, boolean replace ) {
matchesLabel.setText( result.getMarkedCount() + " matches" );
replaceMatchesLabel.setText( replace ? result.getCount() + " matches replaced" : null );
findField.setOutline( result.getMarkedCount() > 0 ? null : "error" );
}
private void notifyEditorAction( String actionKey ) {

View File

@@ -224,6 +224,9 @@ class FlatThemeEditorPane
textArea.reload();
textArea.select( selectionStart, selectionEnd );
if( findReplaceBar != null && findReplaceBar.isShowing() )
findReplaceBar.markAll();
} catch( IOException ex ) {
JOptionPane.showMessageDialog( this,
"Failed to reload '" + textArea.getFileName() + "'\n\nReason: " + ex.getMessage(),