Skip to content
Snippets Groups Projects
Commit 9ac0db07 authored by john's avatar john
Browse files

bug fix

parent ab7b4666
No related branches found
No related tags found
No related merge requests found
...@@ -182,8 +182,12 @@ class TrackChangesProvider { ...@@ -182,8 +182,12 @@ class TrackChangesProvider {
const isOnLeftEdge = this.isOnLeftEdge(annotation) const isOnLeftEdge = this.isOnLeftEdge(annotation)
const isOnRightEdge = this.isOnRightEdge(annotation) const isOnRightEdge = this.isOnRightEdge(annotation)
const isFromSameUser = this.isAnnotationFromTheSameUser(annotation) const isFromSameUser = this.isAnnotationFromTheSameUser(annotation)
const mode = this.getMode()
const key = direction.key const key = direction.key
// use this variable to throw the flow to the isOnDelete handler underneath
let pass = false
// when on own additions, simply delete the character // when on own additions, simply delete the character
// unless it is on the edge: then make a deletion annotation // unless it is on the edge: then make a deletion annotation
...@@ -193,14 +197,12 @@ class TrackChangesProvider { ...@@ -193,14 +197,12 @@ class TrackChangesProvider {
(isOnRightEdge && key === 'DELETE') || (isOnRightEdge && key === 'DELETE') ||
(!isFromSameUser && !isOnDelete) (!isFromSameUser && !isOnDelete)
) { ) {
return this.selectCharacterAndMarkDeleted(options) if (mode) return this.selectCharacterAndMarkDeleted(options)
pass = true
} }
if (!isFromSameUser && isOnDelete) { if (!isFromSameUser && isOnDelete) pass = true
// pass -- jump to 'is on delete' handler underneath if (!pass) return this.deleteCharacter(direction.move)
} else {
return this.deleteCharacter(direction.move)
}
} }
if (isOnDelete) { if (isOnDelete) {
...@@ -297,6 +299,7 @@ class TrackChangesProvider { ...@@ -297,6 +299,7 @@ class TrackChangesProvider {
}) })
each(ownAdditions, (annotation) => { each(ownAdditions, (annotation) => {
console.log(annotation)
const selection = annotation.getSelection() const selection = annotation.getSelection()
// make sure only the part of the annotation that is selected is deleted // make sure only the part of the annotation that is selected is deleted
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment