make sure that markers are correct without reinit

This commit is contained in:
Kevin Jahns
2021-12-06 21:22:18 +01:00
parent 4356d70ed0
commit 6230abb78c
3 changed files with 1 additions and 16 deletions

View File

@@ -43,7 +43,6 @@ export const useSearchMarker = (tr, yarray, index, f) => {
const sm = new ListIterator(yarray).forward(tr, index)
searchMarker.push(sm)
if (sm.nextItem) sm.nextItem.marker = true
return f(sm)
}
const sm = searchMarker.reduce(
(a, b, arrayIndex) => math.abs(index - a.index) < math.abs(index - b.index) ? a : b
@@ -54,8 +53,6 @@ export const useSearchMarker = (tr, yarray, index, f) => {
const prevItem = /** @type {Item} */ (sm.nextItem)
if (createFreshMarker) {
searchMarker.push(fsm)
} else {
fsm.reinit(tr)
}
const diff = fsm.index - index
if (diff > 0) {