When pressing Cmd+Z or Ctrl+Z after deleting few characters in a row, I would expect the data object to contain all the changes that will be reapplied to the editor.
Unfortunately, it looks like only one of character appears to be in the object.
From the gif below, the text "some text" get deleted one character after the other.
After pressing Cmd+Z, all the text "some text" is displayed again but the text field in the data object only contains the first letter "s".
I would have expected the data object to look like the following
One of the workaround is to set the historyEventDelay option to 1 (default is 500ms), this way every action on the text editor will be added to the history (otherwise the history is changed every 500ms)
Hello there,
When pressing Cmd+Z or Ctrl+Z after deleting few characters in a row, I would expect the
data
object to contain all the changes that will be reapplied to the editor. Unfortunately, it looks like only one of character appears to be in the object.From the gif below, the text "some text" get deleted one character after the other. After pressing Cmd+Z, all the text "some text" is displayed again but the
text
field in thedata
object only contains the first letter "s".I would have expected the data object to look like the following
{ cancel: ƒ (), canceled: true, from: Pos {line: 0, ch: 1, sticky: null}, origin: "undo", text: ["some text"], to: Pos {line: 0, ch: 1, sticky: null} }
But instead, we get the following object { cancel: ƒ (), canceled: true, from: Pos {line: 0, ch: 1, sticky: null}, origin: "undo", text: ["s"], to: Pos {line: 0, ch: 1, sticky: null} }
Can you confirm that this a bug in the library?
Thank you for the great library,
Fred