chore(script): adjust scripts format

This commit is contained in:
Skylot
2023-09-12 19:52:50 +01:00
parent 24657f6b3c
commit 2dc0db230c
13 changed files with 59 additions and 38 deletions
@@ -20,24 +20,22 @@ jadx.gui.ifAvailable {
fun setBookmark(node: ICodeNodeRef) {
val enclosing = jadx.gui.enclosingNodeUnderCaret ?: run {
jadx.log.info { "No enclosing node" }
log.info { "No enclosing node" }
return
}
// You can bookmark a field, method or a class
val target = if (enclosing is MethodNode) enclosing else node
jadx.log.info { "Setting bookmark to: $target" }
log.info { "Setting bookmark to: $target" }
savedBookmark = target
}
fun jumpToBookmark() {
if (savedBookmark == null) {
jadx.log.info { "No bookmark" }
} else {
val res = jadx.gui.open(savedBookmark!!)
if (!res) {
jadx.log.info { "Failed to jump to bookmark" }
savedBookmark?.let {
if (!jadx.gui.open(it)) {
log.warn { "Failed to jump to bookmark: $it" }
}
} ?: run {
log.info { "No bookmark" }
}
}