From adf0add5aee29ee2e9efb1ac9956883619f60257 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Mon, 19 Nov 2012 20:22:59 +0100 Subject: some debug output when pushing/popping undo tokens --- undo.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/undo.cpp b/undo.cpp index da0b593..8072540 100644 --- a/undo.cpp +++ b/undo.cpp @@ -1,7 +1,9 @@ +#include #include #include #include +#include #include @@ -9,6 +11,8 @@ #include "interface.h" #include "undo.h" +//#define DEBUG + UndoStack undo; void @@ -21,6 +25,9 @@ void UndoStack::push(UndoToken *token) { if (enabled) { +#ifdef DEBUG + g_printf("UNDO PUSH %p\n", token); +#endif token->pos = strlen(cmdline); SLIST_INSERT_HEAD(&head, token, tokens); } else { @@ -39,6 +46,10 @@ UndoStack::pop(gint pos) { while (!SLIST_EMPTY(&head) && SLIST_FIRST(&head)->pos >= pos) { UndoToken *top = SLIST_FIRST(&head); +#ifdef DEBUG + g_printf("UNDO POP %p\n", top); + fflush(stdout); +#endif top->run(); -- cgit v1.2.3