Theme Editor:

- save/restore selection when reloading file (if changed outside)
- select all text in find field when pressing Ctrl+F
- use lighter color for operators (e.g. '=')
This commit is contained in:
Karl Tauber
2021-01-15 16:15:05 +01:00
parent e9ec769340
commit ed5180ffd6
3 changed files with 8 additions and 1 deletions

View File

@@ -93,6 +93,8 @@ class FlatFindReplaceBar
String selectedText = textArea.getSelectedText();
if( !StringUtils.isEmpty( selectedText ) && selectedText.indexOf( '\n' ) < 0 )
findField.setText( selectedText );
else
findField.selectAll();
// if showing bar, highlight matches in editor
// (not invoking this from addNotify() because this would break the slide-in animation)

View File

@@ -185,7 +185,12 @@ class FlatThemeEditorPane
}
try {
int selectionStart = textArea.getSelectionStart();
int selectionEnd = textArea.getSelectionEnd();
textArea.reload();
textArea.select( selectionStart, selectionEnd );
} catch( IOException ex ) {
JOptionPane.showMessageDialog( this,
"Failed to reload '" + textArea.getFileName() + "'\n\nReason: " + ex.getMessage(),

View File

@@ -62,7 +62,7 @@
<style token="MARKUP_CDATA" fg="cc6600"/>
<style token="MARKUP_CDATA_DELIMITER" fg="008080"/>
<style token="MARKUP_ENTITY_REFERENCE" fg="008000"/>
<style token="OPERATOR" fg="000000"/>
<style token="OPERATOR" fg="888888"/>
<style token="PREPROCESSOR" fg="808080"/>
<style token="REGEX" fg="008040"/>
<style token="SEPARATOR" fg="ff0000"/>