diff --git a/src/definitions.h b/src/definitions.h index e0b458e6..8e9f3db6 100644 --- 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 index 910fabab..86626dbb 100644 --- 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 */