mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-05 16:28:49 +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
0092cfeaa9
commit
d3001ab120
1 changed files with 12 additions and 1 deletions
|
|
@ -212,7 +212,7 @@ func GetBlockSiblingID(id string) (parent, previous, next string) {
|
|||
|
||||
parent = parentBlock.ID
|
||||
if ast.NodeDocument == parentBlock.Type {
|
||||
parent = parentBlock.ID
|
||||
parent = treenode.FirstLeafBlock(parentBlock).ID
|
||||
|
||||
if nil != current.Previous && current.Previous.IsBlock() {
|
||||
previous = current.Previous.ID
|
||||
|
|
@ -230,6 +230,16 @@ func GetBlockSiblingID(id string) (parent, previous, next string) {
|
|||
return
|
||||
}
|
||||
|
||||
if ast.NodeListItem != parentBlock.Type {
|
||||
if parentBlock = treenode.ParentBlock(parentBlock); nil != parentBlock {
|
||||
parent = parentBlock.ID
|
||||
if ast.NodeDocument == parentBlock.Type {
|
||||
parent = treenode.FirstLeafBlock(parentBlock).ID
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
parentBlock = treenode.ParentBlock(current)
|
||||
for ; nil != parentBlock; parentBlock = treenode.ParentBlock(parentBlock) {
|
||||
if nil != parentBlock.Previous && parentBlock.Previous.IsBlock() {
|
||||
previous = parentBlock.Previous.ID
|
||||
|
|
@ -239,6 +249,7 @@ func GetBlockSiblingID(id string) (parent, previous, next string) {
|
|||
break
|
||||
}
|
||||
}
|
||||
|
||||
parentBlock = treenode.ParentBlock(current)
|
||||
for ; nil != parentBlock; parentBlock = treenode.ParentBlock(parentBlock) {
|
||||
if nil != parentBlock.Next && parentBlock.Next.IsBlock() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue