tweaks: rename another type, again to better fit the general pattern

master
Benno Schulenberg 2019-10-02 19:08:24 +02:00
parent 9bd60e7d5d
commit 01b840890d
2 changed files with 10 additions and 9 deletions

View File

@ -295,15 +295,16 @@ typedef struct linestruct {
} linestruct; } linestruct;
#ifndef NANO_TINY #ifndef NANO_TINY
typedef struct undo_group { typedef struct groupstruct {
ssize_t top_line; ssize_t top_line;
/* First line of group. */ /* First line of group. */
ssize_t bottom_line; ssize_t bottom_line;
/* Last line of group. */ /* Last line of group. */
char **indentations; char **indentations;
/* String data used to restore the affected lines; one per line. */ /* String data used to restore the affected lines; one per line. */
struct undo_group *next; struct groupstruct *next;
} undo_group; /* The next group, if any. */
} groupstruct;
typedef struct undostruct { typedef struct undostruct {
ssize_t lineno; ssize_t lineno;
@ -319,7 +320,7 @@ typedef struct undostruct {
/* The file size after the action. */ /* The file size after the action. */
int xflags; int xflags;
/* Some flag data we need. */ /* Some flag data we need. */
undo_group *grouping; groupstruct *grouping;
/* Undo info specific to groups of lines. */ /* Undo info specific to groups of lines. */
linestruct *cutbuffer; linestruct *cutbuffer;
/* Copy of the cutbuffer. */ /* Copy of the cutbuffer. */

View File

@ -289,7 +289,7 @@ void do_unindent(void)
/* Perform an undo or redo for an indent or unindent action. */ /* Perform an undo or redo for an indent or unindent action. */
void handle_indent_action(undostruct *u, bool undoing, bool add_indent) void handle_indent_action(undostruct *u, bool undoing, bool add_indent)
{ {
undo_group *group = u->grouping; groupstruct *group = u->grouping;
linestruct *line = line_from_number(group->top_line); linestruct *line = line_from_number(group->top_line);
if (group->next != NULL) if (group->next != NULL)
@ -446,7 +446,7 @@ void do_comment(void)
/* Perform an undo or redo for a comment or uncomment action. */ /* Perform an undo or redo for a comment or uncomment action. */
void handle_comment_action(undostruct *u, bool undoing, bool add_comment) void handle_comment_action(undostruct *u, bool undoing, bool add_comment)
{ {
undo_group *group = u->grouping; groupstruct *group = u->grouping;
/* When redoing, reposition the cursor and let the commenter adjust it. */ /* When redoing, reposition the cursor and let the commenter adjust it. */
if (!undoing) if (!undoing)
@ -1087,7 +1087,7 @@ bool execute_command(const char *command)
void discard_until(const undostruct *thisitem, openfilestruct *thefile, bool keep) void discard_until(const undostruct *thisitem, openfilestruct *thefile, bool keep)
{ {
undostruct *dropit = thefile->undotop; undostruct *dropit = thefile->undotop;
undo_group *group; groupstruct *group;
while (dropit != NULL && dropit != thisitem) { while (dropit != NULL && dropit != thisitem) {
thefile->undotop = dropit->next; thefile->undotop = dropit->next;
@ -1095,7 +1095,7 @@ void discard_until(const undostruct *thisitem, openfilestruct *thefile, bool kee
free_lines(dropit->cutbuffer); free_lines(dropit->cutbuffer);
group = dropit->grouping; group = dropit->grouping;
while (group != NULL) { while (group != NULL) {
undo_group *next = group->next; groupstruct *next = group->next;
free_chararray(group->indentations, free_chararray(group->indentations,
group->bottom_line - group->top_line); group->bottom_line - group->top_line);
free(group); free(group);
@ -1263,7 +1263,7 @@ void update_multiline_undo(ssize_t lineno, char *indentation)
u->grouping->indentations[number_of_lines - 1] = mallocstrcpy(NULL, u->grouping->indentations[number_of_lines - 1] = mallocstrcpy(NULL,
indentation); indentation);
} else { } else {
undo_group *born = (undo_group *)nmalloc(sizeof(undo_group)); groupstruct *born = nmalloc(sizeof(groupstruct));
born->next = u->grouping; born->next = u->grouping;
u->grouping = born; u->grouping = born;