diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-19 20:22:59 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-20 06:07:33 +0100 |
commit | adf0add5aee29ee2e9efb1ac9956883619f60257 (patch) | |
tree | f6d50fcd5aa7a538c513eb81632bd55c120fed0c | |
parent | 39f102571dc8b5c120adf0612dbf3a6b77f3c2cf (diff) | |
download | sciteco-adf0add5aee29ee2e9efb1ac9956883619f60257.tar.gz |
some debug output when pushing/popping undo tokens
-rw-r--r-- | undo.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -1,7 +1,9 @@ +#include <stdio.h> #include <string.h> #include <bsd/sys/queue.h> #include <glib.h> +#include <glib/gstdio.h> #include <Scintilla.h> @@ -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(); |