mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-17 06:52:18 +01:00
Commit a9d10e069d97e0d3ce1e6bb01c3152a7a752ebbd may have caused issues when using IDE CLI
This commit is contained in:
parent
110a6e20d4
commit
09e2fedf52
@ -31,17 +31,17 @@ import processing.app.forms.PasswordAuthorizationDialog;
|
||||
import processing.app.helpers.OSUtils;
|
||||
import processing.app.helpers.PreferencesMapException;
|
||||
import processing.app.packages.UserLibrary;
|
||||
import static processing.app.I18n._;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.io.File;
|
||||
import java.io.FilenameFilter;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import static processing.app.I18n._;
|
||||
|
||||
|
||||
/**
|
||||
* Stores information about files in the current sketch
|
||||
@ -999,7 +999,15 @@ public class Sketch {
|
||||
current = (SketchCodeDocument) data.getCode(which).getMetadata();
|
||||
currentIndex = which;
|
||||
|
||||
SwingUtilities.invokeLater(() -> editor.setCode(current));
|
||||
if (SwingUtilities.isEventDispatchThread()) {
|
||||
editor.setCode(current);
|
||||
} else {
|
||||
try {
|
||||
SwingUtilities.invokeAndWait(() -> editor.setCode(current));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
editor.header.rebuild();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user