Theme Editor:

- fixed duplicate lines action if selection includes line separator at the end
- preview: do not disable internal components of JInternalFrame
This commit is contained in:
Karl Tauber
2021-08-28 14:30:11 +02:00
parent 7ca48bd136
commit 651454170d
2 changed files with 10 additions and 3 deletions

View File

@@ -122,8 +122,15 @@ class FlatSyntaxTextAreaActions
@Override
public void actionPerformedImpl( ActionEvent e, RTextArea textArea ) {
try {
int selStartLine = textArea.getLineOfOffset( textArea.getSelectionStart() );
int selEndLine = textArea.getLineOfOffset( textArea.getSelectionEnd() );
int selStart = textArea.getSelectionStart();
int selEnd = textArea.getSelectionEnd();
int selStartLine = textArea.getLineOfOffset( selStart );
int selEndLine = textArea.getLineOfOffset( selEnd );
// check whether selection end is at the beginning of the next line
if( selEnd > selStart && textArea.getLineOfOffset( selEnd - 1 ) < selEndLine )
selEndLine--;
int linesStart = textArea.getLineStartOffset( selStartLine );
int linesEnd = textArea.getLineEndOffset( selEndLine );

View File

@@ -271,7 +271,7 @@ class FlatThemePreview
if( comp != previewLabel && comp != enabledCheckBox )
comp.setEnabled( enabled );
if( !(comp instanceof Container) )
if( !(comp instanceof Container) || comp instanceof JInternalFrame )
return;
for( Component c : ((Container)comp).getComponents() ) {