🎨 Add two shortcuts for block navigation https://github.com/siyuan-note/siyuan/issues/11193
This commit is contained in:
parent
7615da1561
commit
ef3b7c50e6
1 changed files with 19 additions and 0 deletions
|
@ -129,6 +129,25 @@ func GetBlockSiblingID(id string) (parent, previous, next string) {
|
|||
return
|
||||
}
|
||||
|
||||
var parentList *ast.Node
|
||||
for p := node.Parent; nil != p; p = p.Parent {
|
||||
if ast.NodeList == p.Type {
|
||||
parentList = p
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if nil != parentList {
|
||||
parent = parentList.ID
|
||||
if node.Previous != nil {
|
||||
previous = node.Previous.ID
|
||||
}
|
||||
if node.Next != nil {
|
||||
next = node.Next.ID
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if nil != node.Parent && node.Parent.IsBlock() {
|
||||
parent = node.Parent.ID
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue