Posted 20 years ago
by Boyd
-
Sr. Software Developer,
Patterson Consulting, LLC
I recently starting exploring the concept of automatically formatting code. SyntaxEditor can certainly support this through the UndoableInsert and UndoableDelete methods. My only concern is that I'll have one auto-format action that could potentially involve numerous UndoableInsert/Delete method calls.
Would it be possible to implement a feature that would allow you to group a series of undoable method calls as a single Undo action? You could, for instance, have a 'BeginUndoableGroup' method that could be called first. Then a series of 'UndoableInsert' and 'UndoableDelete' methods followed by a 'EndUndoableGroup' method call. The desired result would be that all the undoable methods called between the Begin/End group method calls would all be undone together (in the reverse order they were implemented) just as if they were a single undoable action.
What are your thoughts?
Would it be possible to implement a feature that would allow you to group a series of undoable method calls as a single Undo action? You could, for instance, have a 'BeginUndoableGroup' method that could be called first. Then a series of 'UndoableInsert' and 'UndoableDelete' methods followed by a 'EndUndoableGroup' method call. The desired result would be that all the undoable methods called between the Begin/End group method calls would all be undone together (in the reverse order they were implemented) just as if they were a single undoable action.
What are your thoughts?