Added Remembering script+folder scroll/caret position when switching between items, saving for pinned items

This commit is contained in:
Jindra Petřík
2023-01-30 22:33:36 +01:00
parent e123bc699f
commit 07df4a8640
11 changed files with 605 additions and 10 deletions
@@ -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();
}