mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 15:40:12 +01:00
🎨 Improve the behavior of Jump to parent block in lists https://github.com/siyuan-note/siyuan/issues/16516
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
20b8566ed8
commit
25ca3be126
1 changed files with 10 additions and 20 deletions
|
|
@ -249,28 +249,18 @@ func GetBlockSiblingID(id string) (parent, previous, next string) {
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
parent = treenode.FirstLeafBlock(parentBlock).ID
|
if ast.NodeDocument == parentBlock.Type {
|
||||||
|
parentBlock = treenode.FirstLeafBlock(parentBlock)
|
||||||
parentBlock = treenode.ParentBlock(current)
|
parent = parentBlock.ID
|
||||||
for ; nil != parentBlock; parentBlock = treenode.ParentBlock(parentBlock) {
|
} else {
|
||||||
if nil != parentBlock.Previous && parentBlock.Previous.IsBlock() {
|
parent = parentBlock.ID
|
||||||
previous = parentBlock.Previous.ID
|
|
||||||
if flb := treenode.FirstChildBlock(parentBlock.Previous); nil != flb {
|
|
||||||
previous = flb.ID
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
parentBlock = treenode.ParentBlock(current)
|
if nil != parentBlock.Previous {
|
||||||
for ; nil != parentBlock; parentBlock = treenode.ParentBlock(parentBlock) {
|
previous = parentBlock.Previous.ID
|
||||||
if nil != parentBlock.Next && parentBlock.Next.IsBlock() {
|
}
|
||||||
next = parentBlock.Next.ID
|
if nil != parentBlock.Next {
|
||||||
if flb := treenode.FirstChildBlock(parentBlock.Next); nil != flb {
|
next = parentBlock.Next.ID
|
||||||
next = flb.ID
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue