diff options
author | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2016-11-23 03:27:44 +0100 |
---|---|---|
committer | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2016-11-23 03:27:44 +0100 |
commit | 62aa39099e0b1f8e4d86ff9239c8f52ad017ab54 (patch) | |
tree | 945b901a7e26d7b58a4dd2b7250fd54dc6b740e9 /src/actions.c | |
parent | 47b4beb0009cb886ef83afb4f015eb79b48475e7 (diff) | |
download | ratpoison-62aa39099e0b1f8e4d86ff9239c8f52ad017ab54.zip |
Keep frame undo/redo local to actions.c
Diffstat (limited to 'src/actions.c')
-rw-r--r-- | src/actions.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/src/actions.c b/src/actions.c index d278a75..ef856cf 100644 --- a/src/actions.c +++ b/src/actions.c @@ -120,11 +120,20 @@ typedef struct char *alias; } alias_t; +typedef struct rp_frame_undo +{ + char *frames; + rp_screen *screen; + struct list_head node; +} rp_frame_undo; + -static LIST_HEAD(user_commands); -static LIST_HEAD(rp_keymaps); -static LIST_HEAD(set_vars); +static LIST_HEAD (user_commands); +static LIST_HEAD (rp_keymaps); +static LIST_HEAD (set_vars); +static LIST_HEAD (rp_frame_undos); +static LIST_HEAD (rp_frame_redos); static alias_t *alias_list; static int alias_list_size; @@ -634,7 +643,7 @@ clear_frame_redos (void) } } -void +static void del_frame_undo (rp_frame_undo *u) { if (!u) return; @@ -643,6 +652,18 @@ del_frame_undo (rp_frame_undo *u) free (u); } +void +clear_frame_undos (void) +{ + while (list_size (&rp_frame_undos) > 0) + { + /* Delete the oldest node */ + rp_frame_undo *cur; + list_last (cur, &rp_frame_undos, node); + del_frame_undo (cur); + } +} + static void push_frame_undo(rp_screen *screen) { |