I have a plugin that mainly offers text editing commands. A nice feature that other editors have is the possibility to restrict undo actions to a specific part of a file.
More specifically, the functionality I would like to implement is that if there is an active selection in the current editor, pressing my undo action will only undo changes that were made within the selection, even if other changes have been made in other parts of the file.
Is this possible? I have browsed through the code and extension points related to undo, but I haven't found any obvious way of jacking into the undo functionality.