Renaming the parameter 'current_action' to 'action',

in order to match the other functions.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5254 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg 2015-06-17 11:18:20 +00:00
parent ef2593695d
commit 86cbd959f6
3 changed files with 12 additions and 10 deletions

View File

@ -9,6 +9,8 @@
* src/text.c (do_undo): Adjust whitespace after the previous change.
* src/text.c (add_undo): Elide an unneeded variable and correct two
comments. And try to put the more frequent condition first.
* src/text.c (add_undo): Rename the parameter 'current_action' to
'action', to match the other functions.
2015-06-14 Benno Schulenberg <bensberg@justemail.net>
* src/winio.c (edit_draw): Add some debugging code to track which

View File

@ -734,7 +734,7 @@ void new_magicline(void);
void remove_magicline(void);
void mark_order(const filestruct **top, size_t *top_x, const filestruct
**bot, size_t *bot_x, bool *right_side_up);
void add_undo(undo_type current_action);
void add_undo(undo_type action);
void update_undo(undo_type action);
#endif
size_t get_totsize(const filestruct *begin, const filestruct *end);

View File

@ -871,7 +871,7 @@ bool execute_command(const char *command)
}
/* Add a new undo struct to the top of the current pile. */
void add_undo(undo_type current_action)
void add_undo(undo_type action)
{
openfilestruct *fs = openfile;
undo *u = fs->current_undo;
@ -880,11 +880,11 @@ void add_undo(undo_type current_action)
/* When doing contiguous adds or contiguous cuts -- which means: with
* no cursor movement in between -- don't add a new undo item. */
if (u && u->mark_begin_lineno == fs->current->lineno &&
((current_action == ADD && u->type == ADD && u->mark_begin_x == fs->current_x) ||
(current_action == CUT && u->type == CUT && !u->mark_set && keeping_cutbuffer())))
((action == ADD && u->type == ADD && u->mark_begin_x == fs->current_x) ||
(action == CUT && u->type == CUT && !u->mark_set && keeping_cutbuffer())))
return;
/* When trying to delete the final newline, don't add an undo for it. */
if (current_action == DEL && openfile->current->next == openfile->filebot &&
if (action == DEL && openfile->current->next == openfile->filebot &&
openfile->current->data[openfile->current_x] == '\0' &&
openfile->current_x != 0 && !ISSET(NO_NEWLINES))
return;
@ -901,7 +901,7 @@ void add_undo(undo_type current_action)
/* Allocate and initialize a new undo type. */
u = (undo *) nmalloc(sizeof(undo));
u->type = current_action;
u->type = action;
u->lineno = fs->current->lineno;
u->begin = fs->current_x;
#ifndef DISABLE_WRAPPING
@ -952,11 +952,11 @@ void add_undo(undo_type current_action)
}
u->strdata = mallocstrcpy(NULL, fs->current->next->data);
}
current_action = u->type = JOIN;
action = u->type = JOIN;
break;
#ifndef DISABLE_WRAPPING
case SPLIT_BEGIN:
current_action = fs->undotop->type;
action = fs->undotop->type;
break;
case SPLIT_END:
break;
@ -1004,10 +1004,10 @@ void add_undo(undo_type current_action)
#ifdef DEBUG
fprintf(stderr, "fs->current->data = \"%s\", current_x = %lu, u->begin = %lu, type = %d\n",
fs->current->data, (unsigned long)fs->current_x, (unsigned long)u->begin, current_action);
fs->current->data, (unsigned long)fs->current_x, (unsigned long)u->begin, action);
fprintf(stderr, "left add_undo...\n");
#endif
fs->last_action = current_action;
fs->last_action = action;
}
/* Update an undo item, or determine whether a new one is really needed