mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-07 22:40:53 +03:00
Theme Editor: avoid changing editor text (and adding item to undo history) when simply pressing OK button in "Insert Color" dialog without changing anything
This commit is contained in:
@@ -345,7 +345,13 @@ class FlatSyntaxTextAreaActions
|
||||
restore.run();
|
||||
|
||||
// update editor
|
||||
textArea.replaceRange( colorToString( chooser.getColor() ), start, start + length.get() );
|
||||
String newStr = colorToString( chooser.getColor() );
|
||||
try {
|
||||
if( !newStr.equals( textArea.getText( start, length.get() ) ) )
|
||||
textArea.replaceRange( newStr, start, start + length.get() );
|
||||
} catch( BadLocationException ex ) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
// remember selected tab
|
||||
if( tabbedPane instanceof JTabbedPane )
|
||||
|
||||
Reference in New Issue
Block a user