diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2014-09-12 15:49:06 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2014-09-12 15:51:52 +0200 |
| commit | f34c99b1d5337d402c049af21c9ec8f1fe6ef02a (patch) | |
| tree | 0d3342bd3264e6f22e80a75fb3b56ab2a7d95688 | |
| parent | 996c8019e45c7ee268ebc7388142e9ff10d4726d (diff) | |
| download | vis-f34c99b1d5337d402c049af21c9ec8f1fe6ef02a.tar.gz vis-f34c99b1d5337d402c049af21c9ec8f1fe6ef02a.tar.xz | |
Make sure that the state is consistent after an undo operation
When performing an undo operation, further changes should not be
accounted to the then active action. Therefore take a snapshot
which resets txt->current_action to NULL.
| -rw-r--r-- | text.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -550,6 +550,8 @@ bool text_insert(Text *txt, size_t pos, const char *data) { size_t text_undo(Text *txt) { size_t pos = -1; + /* taking a snapshot makes sure that txt->current_action is reset */ + text_snapshot(txt); Action *a = action_pop(&txt->undo); if (!a) return pos; |
