commit 9709dfd563168e007af8e641a9d922f1fd529916
parent 6dd5a75d1356b81295319527a61cdebd0e3b8acd
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Tue, 22 Sep 2020 10:12:43 +0200
tweaks: rename two elements of history struct, away from abbreviations
Diffstat:
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/definitions.h b/src/definitions.h
@@ -341,11 +341,11 @@ typedef struct undostruct {
#ifdef ENABLE_HISTORIES
typedef struct poshiststruct {
char *filename;
- /* The file. */
- ssize_t lineno;
- /* Line number we left off on. */
- ssize_t xno;
- /* The x position in the file we left off on. */
+ /* The full path plus name of the file. */
+ ssize_t linenumber;
+ /* The line where the cursor was when we closed the file. */
+ ssize_t columnnumber;
+ /* The column where the cursor was. */
struct poshiststruct *next;
/* The next item of position history. */
} poshiststruct;
diff --git a/src/history.c b/src/history.c
@@ -419,8 +419,8 @@ void load_poshistory(void)
/* Create a new position record. */
newrecord = nmalloc(sizeof(poshiststruct));
newrecord->filename = copy_of(line);
- newrecord->lineno = atoi(lineptr);
- newrecord->xno = atoi(xptr);
+ newrecord->linenumber = atoi(lineptr);
+ newrecord->columnnumber = atoi(xptr);
newrecord->next = NULL;
/* Add the record to the list. */
@@ -474,7 +474,7 @@ void save_poshistory(void)
* plus two spaces, plus the line feed, plus the null byte. */
path_and_place = nmalloc(strlen(posptr->filename) + 44);
sprintf(path_and_place, "%s %zd %zd\n",
- posptr->filename, posptr->lineno, posptr->xno);
+ posptr->filename, posptr->linenumber, posptr->columnnumber);
length = strlen(path_and_place);
/* Encode newlines in filenames as NULs. */
@@ -573,8 +573,8 @@ void update_poshistory(void)
}
/* Store the last cursor position. */
- theone->lineno = openfile->current->lineno;
- theone->xno = xplustabs() + 1;
+ theone->linenumber = openfile->current->lineno;
+ theone->columnnumber = xplustabs() + 1;
theone->next = NULL;
free(fullpath);
@@ -604,8 +604,8 @@ bool has_old_position(const char *file, ssize_t *line, ssize_t *column)
if (posptr == NULL)
return FALSE;
- *line = posptr->lineno;
- *column = posptr->xno;
+ *line = posptr->linenumber;
+ *column = posptr->columnnumber;
return TRUE;
}
#endif /* ENABLE_HISTORIES */