Let's say I have a syntax editor control whose text is updated when an object's properties change. For instance, if an object has a width property and the user changes it in a property grid, the syntax editor's text would be updated to show the new value of width.
Now, let's further suppose that are some property changes that produce text changes that create more than 1 undo event. So, a single property change might generate N undo items on the syntax editor's undo stack.
Is there a way to group undo events (for a text change) tied to a single property change? The desire is that when a user presses Ctrl+Z to undo the property change, all the editor's undo items related to the change are processed, as opposed to only undo'ing the most recent text change?
If there isn't a built-in mechanism for this, do you have any recommendations regarding how to accomplish this, or things to not do?