Insert new item after closed folds
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
3609b5020f
commit
8fd30fdb03
|
@ -46,12 +46,19 @@ function createCursor(start) {
|
||||||
if (cursor >= store.length()) {
|
if (cursor >= store.length()) {
|
||||||
cursor = store.length() - 1
|
cursor = store.length() - 1
|
||||||
}
|
}
|
||||||
cursor = store.firstSameIndented(cursor, item.idented)
|
cursor = store.firstSameIndented(cursor, item.indented)
|
||||||
},
|
},
|
||||||
insertAbove(store, item) {
|
insertAbove(store, item) {
|
||||||
store.insertBefore(store.currentID(cursor), item)
|
store.insertBefore(store.currentID(cursor), item)
|
||||||
},
|
},
|
||||||
insertBelow(store, item) {
|
insertBelow(store, item) {
|
||||||
|
let currentID = store.currentID(cursor)
|
||||||
|
let currentItem = store.value(currentID)
|
||||||
|
if (currentItem.fold !== 'open') {
|
||||||
|
cursor = store.lastHigherIndented(cursor)
|
||||||
|
item.indented = currentItem.indented
|
||||||
|
cursor--
|
||||||
|
}
|
||||||
let id = store.insertAfter(store.currentID(cursor), item)
|
let id = store.insertAfter(store.currentID(cursor), item)
|
||||||
cursor = store.index(id)
|
cursor = store.index(id)
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user