commit fb372ed0a897992407b066b3157eeec45b7178ff
parent ed433f6af01e188ede8883f9ce67334dd7bc11ca
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 1 Jun 2018 20:32:58 +0200
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.
Diffstat:
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/ChangeLog.2007-2015 b/ChangeLog.2007-2015
@@ -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
diff --git a/src/text.c b/src/text.c
@@ -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;