Skip to content

Commit 72a9633

Browse files
committed
Hide REPL pane unless "persistent" is checked
This fixes a bug where resizing the tab's JSplitPane divider to make the output pane taller instead results in the REPL "emerging" while in non-persistent mode. This was happening because the screenAndPromptSplit prioritized keeping its JSplitPane divider at the same integer value, resulting in the output pane height staying constant and the REPL pane's height increasing. By setting the REPL pane to invisible, the resizing logic now instead gives the extra space to the output pane, as desired.
1 parent 7780e45 commit 72a9633

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/org/scijava/ui/swing/script/TextEditorTab.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
package org.scijava.ui.swing.script;
3333

34+
import java.awt.Dimension;
3435
import java.awt.Font;
3536
import java.awt.GridBagConstraints;
3637
import java.awt.GridBagLayout;
@@ -251,6 +252,8 @@ public void actionPerformed(ActionEvent e) {
251252
prompt.setEnabled(false);
252253

253254
final JPanel prompt_panel = new JPanel();
255+
prompt_panel.setMinimumSize(new Dimension(0, 0));
256+
prompt_panel.setVisible(false);
254257
prompt_panel.setLayout(new GridBagLayout());
255258

256259
bc.gridx = 0;
@@ -315,6 +318,7 @@ public void actionPerformed(ActionEvent a) {
315318
prompt_title.setText(incremental.isSelected() ? //
316319
"REPL: " + textEditor.getCurrentLanguage().getLanguageName() : "");
317320
prompt.setEnabled(incremental.isSelected());
321+
prompt_panel.setVisible(incremental.isSelected());
318322
});
319323

320324
screenAndPromptSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, bottom, prompt_panel);

0 commit comments

Comments
 (0)