tweaks: remove two superfluous assignments

The variable 'last_action' is set at the end of these functions,
serving to prevent a fresh action from being merged with an older
action further down on the stack.  Setting 'last_action' before
exiting from undo()/redo() makes no sense.

Also adjust a sideways related old Changelog item.
This commit is contained in:
Benno Schulenberg 2018-06-01 20:32:58 +02:00
parent ed433f6af0
commit fb372ed0a8
2 changed files with 4 additions and 6 deletions

View File

@ -3555,10 +3555,10 @@ GNU nano 2.1.4 - 2008.08.09
* text.c (add_undo): Fix check for multi-line cut check skips adding other new legit events.
2008-07-23 Chris Allegretta <chrisa@asty.org>
* text.c: Reset openfile-> to OTHER after an undo or redo so we don't
mistakenly think this is an update when it's really an add. Also
fix an extra ; after an if statement which makes nano try to free
a struct which may be NULL.
* text.c: Reset openfile->last_action to OTHER after an undo or redo
so we don't mistakenly think this is an update when it's really an
add. Also fix a mistaken ; after an if statement which made nano
try to free a struct which might be NULL.
GNU nano 2.1.3 - 2008.08.04

View File

@ -764,7 +764,6 @@ void do_undo(void)
case SPLIT_END:
goto_line_posx(u->lineno, u->begin);
openfile->current_undo = openfile->current_undo->next;
openfile->last_action = OTHER;
while (openfile->current_undo->type != SPLIT_BEGIN)
do_undo();
u = openfile->current_undo;
@ -939,7 +938,6 @@ void do_redo(void)
case SPLIT_BEGIN:
goto_line_posx(u->lineno, u->begin);
openfile->current_undo = u;
openfile->last_action = OTHER;
while (openfile->current_undo->type != SPLIT_END)
do_redo();
u = openfile->current_undo;