diff --git a/CHANGELOG.md b/CHANGELOG.md index efc95fe59..a032a522c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ All notable changes to this project will be documented in this file. - AS3 Debugging - activation object was not visible in locals - Linenumbers are visible even if debug markers are used - Marker of stack frames not properly cleared +- Retain AS3 script selection in the tree after its editation and saving whole SWF ### 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/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 601c62660..955a8b881 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -4359,9 +4359,9 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se } public void refreshTree(Openable[] openables) { - TreeItem treeItem = null; + String selectionPath = null; if (currentView == VIEW_RESOURCES || currentView == VIEW_TAGLIST) { - treeItem = getCurrentTree().getCurrentTreeItem(); + selectionPath = getCurrentTree().getSelectionPathString(); } clear(); @@ -4369,23 +4369,12 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se tagTree.updateSwfs(openables); tagListTree.updateSwfs(openables); - - if (treeItem != null) { - Openable openable = treeItem.getOpenable(); - - if (openable instanceof SWF) { - SWF swf = (SWF) openable; - SWF treeItemSwf = swf.getRootSwf(); - if (this.openables.contains(treeItemSwf.openableList)) { - setTagTreeSelectedNode(getCurrentTree(), treeItem); - } - } else if (openable != null) { - if (this.openables.contains(openable.getOpenableList())) { - setTagTreeSelectedNode(getCurrentTree(), treeItem); - } - } + + + getCurrentTree().clearSelection(); + if (selectionPath != null) { + getCurrentTree().setSelectionPathString(selectionPath); } - reload(true); updateMissingNeededCharacters(); pinsPanel.refresh();