undo list access

Find out <oXygen/> related news.
Posts: 20
Joined: Mon Aug 15, 2011 10:57 am

undo list access

Post by Chemo » Fri Feb 08, 2013 7:56 pm


I am developing a plugin, which dynamically creates permanent highlights in the text.
My problem is, that Oxygen sees this automatically created highlights as text changes and adds these changes to the undo list. This ist very uncomfortable for the user, because if he wants to undo (Ctrl+Z) the changes he just made and my plugin just added like 20 highlights, he has to undo all this highlights first.
Is there a way to get access to the undo list or even better a way to prevent oxygen understanding the hightlights as text changes and adding them to the undo history list?


Posts: 7469
Joined: Fri Jul 09, 2004 5:18 pm

Re: undo list access

Post by Radu » Mon Feb 11, 2013 10:10 am

Hi Thomas,

Sorry but no. Persistent highlights represent real modifications which are made to the current document and they are serialized in the saved XML file as processing instructions.
The list of undoable edits (undo/redo) needs to be consistent, to contain all changes which influence the output XML document.

What you could do when you add persistent highlights would be to make a single edit out of this by calling:

Code: Select all

///TODO Then you add all the highlights by calling our API
} finally{

In this way a single "Undo" operation will remove all your highlights.
Radu Coravu
<oXygen/> XML Editor

Post Reply