Skip to content

Commit

Permalink
Merge pull request #3395 from nextcloud/backport/3350/stable25
Browse files Browse the repository at this point in the history
[stable25] Don't apply author annotations when in composition
  • Loading branch information
max-nextcloud authored Nov 9, 2022
2 parents 51c1a50 + da52850 commit 7f50399
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 17 deletions.
4 changes: 2 additions & 2 deletions js/editor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/editor.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-files.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-files.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-public.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-public.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-text.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-text.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-viewer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-viewer.js.map

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions src/extensions/UserColor.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,16 @@ const UserColor = Extension.create({
},

addProseMirrorPlugins() {
let viewReference = null
return [
new Plugin({
clientID: this.options.clientID,
color: this.options.color,
name: this.options.name,
view: (editorView) => {
viewReference = editorView
return {}
},
state: {
init(_, instance) {
return {
Expand All @@ -63,8 +68,11 @@ const UserColor = Extension.create({
// we have an undefined client id for own transactions
tr.setMeta('clientID', tr.steps.map(i => this.spec.clientID))
}
tracked = tracked.applyTransform(tr)
tState = tracked
// Don't apply transaction when in composition (Github issue #2871)
if (!viewReference.composing) {
tracked = tracked.applyTransform(tr)
tState = tracked
}
}
decos = tState.blameMap
.map(span => {
Expand Down

0 comments on commit 7f50399

Please sign in to comment.