Closed mikeysouthwell closed 5 months ago
This is a limitation of the Figma Plugin API. Undo is essentially undoing the setting of the template plugin data on the node.
Saving a template on the node is the equivalent of changing any node property in that it is treated like a change that can be undone with the Figma "undo" command.
Im impressed that you noticed this so quickly! One quirk of plugins thats come up a few times but makes sense when you understand what it is under the hood.
Posisble bug?
If you click on undo in Figma in the main canvas with DevMode off and the Inspect flyout menu minimised, it still undoes the changes that were made to your code snippet, instead of the changes you made on the canvas before opening the Code Snippet Editor.
The intention from the user should be the undo the recent changes on the canvas not from the Code Snippet Editor.