-
Notifications
You must be signed in to change notification settings - Fork 27.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
undo image paste in rendered notebook markdown will just remove the attachment #180866
Comments
This comment was marked as outdated.
This comment was marked as outdated.
I've investigated this issue but am unsure how best to fix it (or even which layer to fix it in). The issue can also happen for normal workspace edits and is not specific to drop or paste. Here's my understanding of the issue:
Notice how there are two undo stacks: one for the cell and one for the notebook. The edit in each of these two stacks has the same
However this code ends up not finding the cell text change because its group order is lower. This means we only undo the metadata change, causing the broken image This same flow works correctly if the cell is still in edit mode and focused. The key difference is that when the cell is being editing, the @rebornix @jrieken For fixing this, should we try to make the Also open to other suggestions as I'm not too familiar with this area of our code |
@mjbvz thanks for the great analysis and it turns out that our undo/redo support (along with By default The challenge here is when it's enabled (default value), cell text model and notebook text model have separate undo/redo stack, which works fine until we create an undo/redo group which pushes UndoElement to both stacks.
Conceptually this is no different from creating an undo/redo group which pushes UndoElements to two separate files' undo stacks. I wonder if we should tweak this piece of code to make it work. cc @alexdima |
Testing #180759
馃悰 broken image link
likely because the undo operation isn't able to edit the markdown content, but the undo operation probably shouldn't happen at all
The text was updated successfully, but these errors were encountered: