Skip to content

Commit

Permalink
call UndoManager pop-stack-item after transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
dmonad committed Nov 13, 2020
1 parent 7bac783 commit e1f0324
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/utils/RelativePosition.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ export const createAbsolutePositionFromRelativePosition = (rpos, doc) => {
/**
* @param {RelativePosition|null} a
* @param {RelativePosition|null} b
* @return {boolean}
*
* @function
*/
Expand Down
6 changes: 3 additions & 3 deletions src/utils/UndoManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ const popStackItem = (undoManager, stack, eventType) => {
}
}
result = stackItem
if (result != null) {
undoManager.emit('stack-item-popped', [{ stackItem: result, type: eventType }, undoManager])
}
}
transaction.changed.forEach((subProps, type) => {
// destroy search marker if necessary
Expand All @@ -130,6 +127,9 @@ const popStackItem = (undoManager, stack, eventType) => {
}
})
}, undoManager)
if (result != null) {
undoManager.emit('stack-item-popped', [{ stackItem: result, type: eventType }, undoManager])
}
return result
}

Expand Down

0 comments on commit e1f0324

Please sign in to comment.