aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-19 20:22:59 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-20 06:07:33 +0100
commitadf0add5aee29ee2e9efb1ac9956883619f60257 (patch)
treef6d50fcd5aa7a538c513eb81632bd55c120fed0c
parent39f102571dc8b5c120adf0612dbf3a6b77f3c2cf (diff)
downloadsciteco-adf0add5aee29ee2e9efb1ac9956883619f60257.tar.gz
some debug output when pushing/popping undo tokens
-rw-r--r--undo.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/undo.cpp b/undo.cpp
index da0b593..8072540 100644
--- a/undo.cpp
+++ b/undo.cpp
@@ -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();