aboutsummaryrefslogtreecommitdiffhomepage
path: root/undo.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-07 21:41:05 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-07 21:41:05 +0100
commit69419eceaca8e347016ccbe42326bcdc881355fc (patch)
tree865c513afc65d4f32a1cb66589d4dc537b2e8a27 /undo.h
parent8888a37426ff514d68c9b91e5f5185dedde9df4a (diff)
downloadsciteco-69419eceaca8e347016ccbe42326bcdc881355fc.tar.gz
undo stack enable/disable, parse-only mode, colon modifiers evaluation
Diffstat (limited to 'undo.h')
-rw-r--r--undo.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/undo.h b/undo.h
index 9c7ac5f..17a8ba8 100644
--- a/undo.h
+++ b/undo.h
@@ -52,7 +52,9 @@ extern class UndoStack {
SLIST_HEAD(undo_head, UndoToken) head;
public:
- UndoStack()
+ bool enabled;
+
+ UndoStack(bool _enabled = true) : enabled(_enabled)
{
SLIST_INIT(&head);
}
@@ -61,7 +63,10 @@ public:
inline void
push(UndoToken *token)
{
- SLIST_INSERT_HEAD(&head, token, tokens);
+ if (enabled)
+ SLIST_INSERT_HEAD(&head, token, tokens);
+ else
+ delete token;
}
void push_msg(unsigned int iMessage,