diff --git a/CHANGELOG.md b/CHANGELOG.md index c74256c59..7578a984e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ All notable changes to this project will be documented in this file. - [#2131] Debugger - Breakpoints can be added while SWF is running (not just on pause) - AS3 Direct editation - types on instance variable values not properly resolved - AS1/2 Debugger - script was cleared on stop button +- AS1/2 Vanishing source code in some cases ### Changed - [#2120] Exported assets no longer take names from assigned classes if there is more than 1 assigned class diff --git a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java index 5099c2a40..4560be348 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java @@ -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); } } diff --git a/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java b/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java index f7148010c..701fd48c7 100644 --- a/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java @@ -516,6 +516,8 @@ public class ActionPanel extends JPanel implements SearchListener { + editor.setShowMarkers(false); setEditorText(asm.getScriptName(), asm.getExportedScriptName(), "; " + AppStrings.translate("work.disassembling") + "...", "text/flasm"); if (decompileNeeded) { + decompiledEditor.setShowMarkers(false); setDecompiledText("-", "-", "// " + AppStrings.translate("work.waitingfordissasembly") + "..."); } }); DisassemblyListener listener = getDisassemblyListener(); asm.addDisassemblyListener(listener); - innerActions = asm.getActions(); + innerActions = asm.getActions(); asm.removeDisassemblyListener(listener); } if (decompileNeeded) { View.execInEventDispatch(() -> { + decompiledEditor.setShowMarkers(false); setDecompiledText("-", "-", "// " + AppStrings.translate("work.decompiling") + "..."); }); @@ -555,6 +560,11 @@ public class ActionPanel extends JPanel implements SearchListener { setSourceCompleted(asm, htext, finalActions); }); + } else { + ActionList finalActions = innerActions; + View.execInEventDispatch(() -> { + setSourceCompleted(asm, fdecompiledText, finalActions); + }); } return null; @@ -571,9 +581,11 @@ public class ActionPanel extends JPanel implements SearchListener bkptLines = Main.getScriptBreakPoints(breakPointScriptName, false); @@ -146,6 +151,14 @@ public class DebuggableEditorPane extends LineMarkedEditorPane implements BreakP } } + public void setShowMarkers(boolean showMarkers) { + this.showMarkers = showMarkers; + } + + public boolean isShowMarkers() { + return showMarkers; + } + @Override public void setText(String t) { super.setText(t);