Don't update the current attributes in case of delete
This commit is contained in:
parent
f215866429
commit
4c19fef998
@ -55,6 +55,26 @@ export class ItemTextListPosition {
|
||||
this.currentAttributes = currentAttributes
|
||||
}
|
||||
|
||||
/**
|
||||
* Don't update the attributes if it is going to be deleted
|
||||
*/
|
||||
forwardWithOutUpdatingAttributes () {
|
||||
if (this.right === null) {
|
||||
error.unexpectedCase()
|
||||
}
|
||||
switch (this.right.content.constructor) {
|
||||
case ContentFormat:
|
||||
break
|
||||
default:
|
||||
if (!this.right.deleted) {
|
||||
this.index += this.right.length
|
||||
}
|
||||
break
|
||||
}
|
||||
this.left = this.right
|
||||
this.right = this.right.right
|
||||
}
|
||||
|
||||
/**
|
||||
* Only call this if you know that this.right is defined
|
||||
*/
|
||||
@ -488,7 +508,7 @@ const deleteText = (transaction, currPos, length) => {
|
||||
break
|
||||
}
|
||||
}
|
||||
currPos.forward()
|
||||
currPos.forwardWithOutUpdatingAttributes()
|
||||
}
|
||||
if (start) {
|
||||
cleanupFormattingGap(transaction, start, currPos.right, startAttrs, currPos.currentAttributes)
|
||||
|
Loading…
x
Reference in New Issue
Block a user