commit 12e5c2f07da77ef6661e653df421b5df4441ba7f
parent 5c07a747bbf03f59e67252ec406f6acfb586b0fa
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 17 Feb 2020 11:32:03 +0100
undo: for an automatic hard-wrap, store the correct previous buffer size
The SPLIT_BEGIN item gets tucked underneath the ADD item on the top of
the undo stack. Thus: that SPLIT_BEGIN item should copy the 'wassize'
of the ADD item instead of storing the current buffer size.
This fixes https://savannah.gnu.org/bugs/?57832.
Bug existed since the undo functionality was added, and existed
in this form since version 2.3.5, commit be10c2a4.
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/src/text.c b/src/text.c
@@ -1142,6 +1142,7 @@ void add_undo(undo_type action, const char *message)
* SPLIT_BEGIN item underneath that action's undo item. Otherwise,
* just add the new item to the top of the undo stack. */
if (u->type == SPLIT_BEGIN) {
+ u->wassize = openfile->undotop->wassize;
u->next = openfile->undotop->next;
openfile->undotop->next = u;
} else