Added SCI_GETUNDOSEQUENCE

"'Neil Hodgson' via scintilla-interest" <[email protected]>
Newsgroups gmane.comp.lib.scintilla.devel
Message-ID <[email protected]>
   A new API SCI_GETUNDOSEQUENCE has been added to Scintilla which returns the current nesting depth of undo actions.

   This is mainly for debugging. Every time an application calls SCI_BEGINUNDOACTION to start an undo action, it must call SCI_ENDUNDOACTION when the action is complete. If the application fails to call SCI_ENDUNDOACTION, perhaps because of an exception or other unexpected situation, then the undo sequence will continue. This may lead to many user actions being undone by a single undo command. A trace of SCI_GETUNDOSEQUENCE can help uncover the problem.

   Unbalanced undo actions can be even more of a problem when an application supports plugins or user scripts that may contain bugs. The application could display a warning if a script doesn't call SCI_ENDUNDOACTION indicated by a positive SCI_GETUNDOSEQUENCE after returning. In some circumstances, it may be reasonable to reset the nesting level by calling SCI_ENDUNDOACTION until SCI_GETUNDOSEQUENCE returns 0.

   There may be a better name for this API. SCI_GETUNDOSEQUENCEDEPTH is a bit closer to what it does but I wanted to emphasize its role in revealing if there is an active undo sequence.

   Neil

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/scintilla-interest/35EE9BBD-CE46-4D77-BE4B-15EB7ABA641F%40me.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.