diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-07 21:41:05 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-07 21:41:05 +0100 |
commit | 69419eceaca8e347016ccbe42326bcdc881355fc (patch) | |
tree | 865c513afc65d4f32a1cb66589d4dc537b2e8a27 /undo.h | |
parent | 8888a37426ff514d68c9b91e5f5185dedde9df4a (diff) | |
download | sciteco-69419eceaca8e347016ccbe42326bcdc881355fc.tar.gz |
undo stack enable/disable, parse-only mode, colon modifiers evaluation
Diffstat (limited to 'undo.h')
-rw-r--r-- | undo.h | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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, |