mirror of git://git.sv.gnu.org/nano.git
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:
parent
ef2593695d
commit
86cbd959f6
|
@ -9,6 +9,8 @@
|
||||||
* src/text.c (do_undo): Adjust whitespace after the previous change.
|
* src/text.c (do_undo): Adjust whitespace after the previous change.
|
||||||
* src/text.c (add_undo): Elide an unneeded variable and correct two
|
* src/text.c (add_undo): Elide an unneeded variable and correct two
|
||||||
comments. And try to put the more frequent condition first.
|
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>
|
2015-06-14 Benno Schulenberg <bensberg@justemail.net>
|
||||||
* src/winio.c (edit_draw): Add some debugging code to track which
|
* src/winio.c (edit_draw): Add some debugging code to track which
|
||||||
|
|
|
@ -734,7 +734,7 @@ void new_magicline(void);
|
||||||
void remove_magicline(void);
|
void remove_magicline(void);
|
||||||
void mark_order(const filestruct **top, size_t *top_x, const filestruct
|
void mark_order(const filestruct **top, size_t *top_x, const filestruct
|
||||||
**bot, size_t *bot_x, bool *right_side_up);
|
**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);
|
void update_undo(undo_type action);
|
||||||
#endif
|
#endif
|
||||||
size_t get_totsize(const filestruct *begin, const filestruct *end);
|
size_t get_totsize(const filestruct *begin, const filestruct *end);
|
||||||
|
|
18
src/text.c
18
src/text.c
|
@ -871,7 +871,7 @@ bool execute_command(const char *command)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add a new undo struct to the top of the current pile. */
|
/* 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;
|
openfilestruct *fs = openfile;
|
||||||
undo *u = fs->current_undo;
|
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
|
/* When doing contiguous adds or contiguous cuts -- which means: with
|
||||||
* no cursor movement in between -- don't add a new undo item. */
|
* no cursor movement in between -- don't add a new undo item. */
|
||||||
if (u && u->mark_begin_lineno == fs->current->lineno &&
|
if (u && u->mark_begin_lineno == fs->current->lineno &&
|
||||||
((current_action == ADD && u->type == ADD && u->mark_begin_x == fs->current_x) ||
|
((action == ADD && u->type == ADD && u->mark_begin_x == fs->current_x) ||
|
||||||
(current_action == CUT && u->type == CUT && !u->mark_set && keeping_cutbuffer())))
|
(action == CUT && u->type == CUT && !u->mark_set && keeping_cutbuffer())))
|
||||||
return;
|
return;
|
||||||
/* When trying to delete the final newline, don't add an undo for it. */
|
/* 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->data[openfile->current_x] == '\0' &&
|
||||||
openfile->current_x != 0 && !ISSET(NO_NEWLINES))
|
openfile->current_x != 0 && !ISSET(NO_NEWLINES))
|
||||||
return;
|
return;
|
||||||
|
@ -901,7 +901,7 @@ void add_undo(undo_type current_action)
|
||||||
|
|
||||||
/* Allocate and initialize a new undo type. */
|
/* Allocate and initialize a new undo type. */
|
||||||
u = (undo *) nmalloc(sizeof(undo));
|
u = (undo *) nmalloc(sizeof(undo));
|
||||||
u->type = current_action;
|
u->type = action;
|
||||||
u->lineno = fs->current->lineno;
|
u->lineno = fs->current->lineno;
|
||||||
u->begin = fs->current_x;
|
u->begin = fs->current_x;
|
||||||
#ifndef DISABLE_WRAPPING
|
#ifndef DISABLE_WRAPPING
|
||||||
|
@ -952,11 +952,11 @@ void add_undo(undo_type current_action)
|
||||||
}
|
}
|
||||||
u->strdata = mallocstrcpy(NULL, fs->current->next->data);
|
u->strdata = mallocstrcpy(NULL, fs->current->next->data);
|
||||||
}
|
}
|
||||||
current_action = u->type = JOIN;
|
action = u->type = JOIN;
|
||||||
break;
|
break;
|
||||||
#ifndef DISABLE_WRAPPING
|
#ifndef DISABLE_WRAPPING
|
||||||
case SPLIT_BEGIN:
|
case SPLIT_BEGIN:
|
||||||
current_action = fs->undotop->type;
|
action = fs->undotop->type;
|
||||||
break;
|
break;
|
||||||
case SPLIT_END:
|
case SPLIT_END:
|
||||||
break;
|
break;
|
||||||
|
@ -1004,10 +1004,10 @@ void add_undo(undo_type current_action)
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "fs->current->data = \"%s\", current_x = %lu, u->begin = %lu, type = %d\n",
|
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");
|
fprintf(stderr, "left add_undo...\n");
|
||||||
#endif
|
#endif
|
||||||
fs->last_action = current_action;
|
fs->last_action = action;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update an undo item, or determine whether a new one is really needed
|
/* Update an undo item, or determine whether a new one is really needed
|
||||||
|
|
Loading…
Reference in New Issue