From 0d01c262c0ed23ef950530c743b023e89ef4a821 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Thu, 8 Nov 2012 02:21:36 +0100 Subject: support line termination ($$) as immediate editing command + some fixes * separate function for immediate editing command processing * undo.clear() to remove and free all undo tokens without executing them * goto_table_clear() to remove and free all goto table entries --- undo.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'undo.cpp') diff --git a/undo.cpp b/undo.cpp index 106f812..7a58c92 100644 --- a/undo.cpp +++ b/undo.cpp @@ -47,6 +47,17 @@ UndoStack::pop(gint pos) } } +void +UndoStack::clear(void) +{ + UndoToken *cur; + + while ((cur = SLIST_FIRST(&head))) { + SLIST_REMOVE_HEAD(&head, tokens); + delete cur; + } +} + UndoStack::~UndoStack() { UndoToken *token, *next; -- cgit v1.2.3