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.
This commit is contained in:
Benno Schulenberg 2020-02-17 11:32:03 +01:00
parent 5c07a747bb
commit 12e5c2f07d

View File

@ -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