You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The undo manager has the ability to not record API-initiated changes on the undo stack. So when an API change comes in, it adjusts all existing entries on the undo and redo stacks to account for the API change. But in the scenario below, it seems to get it wrong.
Thank you for the detailed report. The issue is Quill tries to use the minimal number of changes, as measured by number of characters, and Google and https://www.google.com/ actually share a common "oogle" substring. The fix was to try to use the specified API change instead of always diffing.
Also the final correct state should actually be "Google The lazy fox!" since the linked Google text was added by source = api, the history module when set to userOnly should only undo changes made by source = user. This is most often used in a collaborative environment, for example when two users are working two different paragraphs. If I'm typing away on my paragraph and you are typing away on your paragraph, when I undo a bunch of times, only my paragraph should be affected. So if you inserted Google in your paragraph, me undoing should not remove it.
The undo manager has the ability to not record API-initiated changes on the undo stack. So when an API change comes in, it adjusts all existing entries on the undo and redo stacks to account for the API change. But in the scenario below, it seems to get it wrong.
Steps for Reproduction
Here is what the following test is doing:
The actual steps:
Add the following test to
test/unit/modules/history.js
:Run
npm test
Expected behavior: It should pass. The final
undo()
should leave the document as just 'The lazy fox'Actual behavior: After the final
undo()
, the document is: G The lazy foxPlatforms: Chrome 50.0.2661.102 (64-bit) on Mac 10.11.5
Version: tag v1.0.0-beta.6
The text was updated successfully, but these errors were encountered: