diff options
author | Cristian Maglie <c.maglie@arduino.cc> | 2021-08-18 13:00:38 +0300 |
---|---|---|
committer | Cristian Maglie <c.maglie@arduino.cc> | 2021-08-18 13:00:38 +0300 |
commit | af5a3d7801bbb681c36ac4297c54299e646740d7 (patch) | |
tree | 44ea00a714ed504239a605f7724fe181a8835423 | |
parent | 240e1b5624681ae9d60741be1b9b80489ac26a24 (diff) |
makeup: factor call to tabs.get(index)
-rw-r--r-- | app/src/processing/app/Editor.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index eabeac18e..3b3316f31 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -1450,9 +1450,10 @@ public class Editor extends JFrame implements RunnerListener { // This must be run in the GUI thread SwingUtilities.invokeLater(() -> { codePanel.removeAll(); - codePanel.add(tabs.get(index), BorderLayout.CENTER); - tabs.get(index).requestFocusInWindow(); // get the caret blinking - tabs.get(index).applyPreferences(); + EditorTab selectedTab = tabs.get(index); + codePanel.add(selectedTab, BorderLayout.CENTER); + selectedTab.applyPreferences(); + selectedTab.requestFocusInWindow(); // get the caret blinking // For some reason, these are needed. Revalidate says it should be // automatically called when components are added or removed, but without // it, the component switched to is not displayed. repaint() is needed to |