I have three plugins:
-
enterMark
- When cursor enters a mark, replace it with a text in theappendTransaction
usingtr.replaceWith()
. -
decorateMark
- Apply decorations on the text. -
exitMark
- When cursor exits the text, replace it with a mark inappendTransaction
usingtr.replaceWith()
.
They work fine.
Things go haywire when I redo and undo in the process.
Demo: Glitch :・゚✧
Video demo:
Steps to reproduce
- Place cursor at the right edge of bolded ‘can’.
- Type ‘12’.
- Press left arrow 2 times to arrive at right boundary of ‘can’
- Press right arrow 1 time to exit ‘should’.
- Execute undo 1 time. And execute redo 1 time.
- Press left arrow 1 time to arrive at right boundary of ‘can’
- Execute undo 2 times in a row.