tweaks: rename a variable, to distinguish it from a browser function

master
Benno Schulenberg 2019-04-22 19:45:42 +02:00
parent ea844d28fe
commit 11aa191bdc
5 changed files with 11 additions and 7 deletions

View File

@ -70,7 +70,7 @@ void make_new_buffer(void)
newnode->prev = newnode;
newnode->next = newnode;
firstfile = newnode;
startfile = newnode;
} else {
/* Add the new open file after the current one in the list. */
newnode->prev = openfile;

View File

@ -127,8 +127,10 @@ partition *filepart = NULL;
/* The "partition" where we store a portion of the current file. */
openfilestruct *openfile = NULL;
/* The list of all open file buffers. */
openfilestruct *firstfile = NULL;
#ifdef ENABLE_MULTIBUFFER
openfilestruct *startfile = NULL;
/* The first open buffer. */
#endif
#ifndef NANO_TINY
char *matchbrackets = NULL;

View File

@ -493,8 +493,8 @@ void copy_from_buffer(linestruct *somebuffer)
/* Unlink a node from the rest of the circular list, and delete it. */
void unlink_opennode(openfilestruct *fileptr)
{
if (fileptr == firstfile)
firstfile = firstfile->next;
if (fileptr == startfile)
startfile = startfile->next;
fileptr->prev->next = fileptr->next;
fileptr->next->prev = fileptr->prev;

View File

@ -98,7 +98,9 @@ extern bool keep_cutbuffer;
extern partition *filepart;
extern openfilestruct *openfile;
extern openfilestruct *firstfile;
#ifdef ENABLE_MULTIBUFFER
extern openfilestruct *startfile;
#endif
#ifndef NANO_TINY
extern char *matchbrackets;

View File

@ -2023,7 +2023,7 @@ int buffer_number(openfilestruct *buffer)
{
int count = 1;
while (buffer != firstfile) {
while (buffer != startfile) {
buffer = buffer->prev;
count++;
}
@ -2088,7 +2088,7 @@ void titlebar(const char *path)
if (more_than_one) {
indicator = charalloc(24);
sprintf(indicator, "[%i/%i]", buffer_number(openfile),
buffer_number(firstfile->prev));
buffer_number(startfile->prev));
upperleft = indicator;
} else
#endif