filter empty ranges when calculating minMoveRanges
This commit is contained in:
parent
2e9a7df603
commit
7e9319f82e
@ -15,6 +15,7 @@ import {
|
|||||||
createRelativePosition,
|
createRelativePosition,
|
||||||
RelativePosition, ID, AbstractContent, ContentMove, Transaction, Item, AbstractType // eslint-disable-line
|
RelativePosition, ID, AbstractContent, ContentMove, Transaction, Item, AbstractType // eslint-disable-line
|
||||||
} from '../internals.js'
|
} from '../internals.js'
|
||||||
|
import { compareRelativePositions } from './RelativePosition.js'
|
||||||
|
|
||||||
const lengthExceeded = error.create('Length exceeded!')
|
const lengthExceeded = error.create('Length exceeded!')
|
||||||
|
|
||||||
@ -701,5 +702,6 @@ export const getMinimalListViewRanges = (tr, walker, len) => {
|
|||||||
// Move ranges must be applied in order
|
// Move ranges must be applied in order
|
||||||
middleMove.end = end
|
middleMove.end = end
|
||||||
|
|
||||||
return ranges
|
// filter out unnecessary ranges
|
||||||
|
return ranges.filter(range => !compareRelativePositions(range.start, range.end))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user