January 19th 2020
Get the current state index of the history
the standard custom layer context pointer
the id of the buffer to query
if the buffer exists and has history enabled, the current state index, otherwise zero
The current state index indicates how far backward the user has undone. If the index is the most recent record, then nothing has been undone. This way undo-redo operations do not have to modify the history stack, and instead just move the current state index through the stack. Normal modifications to the buffer cause the history to discard everything after the current state index, before putting the new record on top of the stack.