mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 19:00:47 +00:00
Added Remembering script+folder scroll/caret position when switching between items, saving for pinned items
This commit is contained in:
@@ -94,10 +94,26 @@ public class DecompiledEditorPane extends DebuggableEditorPane implements CaretL
|
||||
private CancellableWorker setSourceWorker;
|
||||
|
||||
private final List<Runnable> scriptListeners = new ArrayList<>();
|
||||
|
||||
private boolean scriptLoaded = true;
|
||||
|
||||
public void addScriptListener(Runnable l) {
|
||||
scriptListeners.add(l);
|
||||
}
|
||||
|
||||
public void runWhenLoaded(Runnable l) {
|
||||
if (scriptLoaded) {
|
||||
l.run();
|
||||
} else {
|
||||
addScriptListener(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
l.run();
|
||||
removeScriptListener(this);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public ABCPanel getAbcPanel() {
|
||||
return abcPanel;
|
||||
@@ -771,11 +787,14 @@ public class DecompiledEditorPane extends DebuggableEditorPane implements CaretL
|
||||
setSourceWorker.cancel(true);
|
||||
setSourceWorker = null;
|
||||
}
|
||||
scriptLoaded = false;
|
||||
|
||||
if (!force && this.script == scriptLeaf) {
|
||||
if (!force && this.script == scriptLeaf) {
|
||||
scriptLoaded = true;
|
||||
fireScript();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
String sn = scriptLeaf.getClassPath().toString();
|
||||
setScriptName(sn);
|
||||
@@ -881,6 +900,8 @@ public class DecompiledEditorPane extends DebuggableEditorPane implements CaretL
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scriptLoaded = true;
|
||||
|
||||
fireScript();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user