mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-08 15:00:54 +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();
|
restore.run();
|
||||||
|
|
||||||
// update editor
|
// 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
|
// remember selected tab
|
||||||
if( tabbedPane instanceof JTabbedPane )
|
if( tabbedPane instanceof JTabbedPane )
|
||||||
|
|||||||
Reference in New Issue
Block a user