Breakpoints are hidden until disassembly/decompilation is complete.

Fixed AS1/2 Vanishing source code in some cases
This commit is contained in:
Jindra Petřík
2023-12-30 18:06:08 +01:00
parent f3e3bd941a
commit b976096e57
4 changed files with 36 additions and 2 deletions
@@ -916,6 +916,7 @@ public class DecompiledEditorPane extends DebuggableEditorPane implements CaretL
if (decompileNeeded) {
//long timeBefore = System.currentTimeMillis();
setShowMarkers(false);
View.execInEventDispatch(() -> {
setText("// " + AppStrings.translate("work.decompiling") + "...");
});
@@ -924,6 +925,7 @@ public class DecompiledEditorPane extends DebuggableEditorPane implements CaretL
//long timeAfter = System.currentTimeMillis();
//long delta = timeAfter - timeBefore;
//System.err.println("Finished in " + Helper.formatTimeSec(delta));
setShowMarkers(true);
View.execInEventDispatch(() -> {
setSourceCompleted(scriptLeaf, htext);
});
@@ -943,12 +945,14 @@ public class DecompiledEditorPane extends DebuggableEditorPane implements CaretL
try {
get();
} catch (CancellationException ex) {
setShowMarkers(false);
setText("// " + AppStrings.translate("work.canceled"));
} catch (Exception ex) {
Throwable cause = ex;
if (ex instanceof ExecutionException) {
cause = ex.getCause();
}
setShowMarkers(false);
if (cause instanceof CancellationException) {
setText("// " + AppStrings.translate("work.canceled"));
} else {
@@ -966,6 +970,7 @@ public class DecompiledEditorPane extends DebuggableEditorPane implements CaretL
Main.startWork(AppStrings.translate("work.decompiling") + "...", worker);
}
} else {
setShowMarkers(true);
setSourceCompleted(scriptLeaf, decompiledText);
}
}