fix(gui): load class code before resolving jump position to get corrent value

This commit is contained in:
Skylot
2026-01-26 19:36:10 +00:00
parent 4e82233cbc
commit 331c4aaa5e
2 changed files with 5 additions and 4 deletions
@@ -228,9 +228,9 @@ public class TabbedPane extends JTabbedPane implements ITabStatesListener {
}
selectTab(contentPanel);
int pos = jumpPos.getPos();
if (pos < 0) {
if (pos <= 0) {
LOG.warn("Invalid jump: {}", jumpPos, new JadxRuntimeException());
pos = 0;
pos = Math.max(0, jumpNode.getPos());
}
contentPanel.scrollToPos(pos);
return contentPanel;
@@ -135,12 +135,13 @@ public class TabsController {
return;
}
}
if (node.getRootClass() == null) {
JClass clsRootClass = node.getRootClass();
if (clsRootClass == null) {
// not a class, select tab (without position scroll)
selectTab(node, fromTree);
return;
}
codeJump(new JumpPosition(node), fromTree);
loadCodeWithUIAction(clsRootClass, () -> codeJump(new JumpPosition(node), fromTree));
}
private void loadCodeWithUIAction(JClass cls, Runnable action) {