fix(gui): load class code before resolving jump position to get corrent value
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user