GtkScintilla::can_undo

int can_undo(void);

Can Undo returns wheather "Undo" Operation may be done or not.

if ($scintilla->can_undo())
{
    // there are something to be "undone"...
}