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->prev = newnode;
newnode->next = newnode; newnode->next = newnode;
firstfile = newnode; startfile = newnode;
} else { } else {
/* Add the new open file after the current one in the list. */ /* Add the new open file after the current one in the list. */
newnode->prev = openfile; newnode->prev = openfile;

View File

@ -127,8 +127,10 @@ partition *filepart = NULL;
/* The "partition" where we store a portion of the current file. */ /* The "partition" where we store a portion of the current file. */
openfilestruct *openfile = NULL; openfilestruct *openfile = NULL;
/* The list of all open file buffers. */ /* The list of all open file buffers. */
openfilestruct *firstfile = NULL; #ifdef ENABLE_MULTIBUFFER
openfilestruct *startfile = NULL;
/* The first open buffer. */ /* The first open buffer. */
#endif
#ifndef NANO_TINY #ifndef NANO_TINY
char *matchbrackets = NULL; 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. */ /* Unlink a node from the rest of the circular list, and delete it. */
void unlink_opennode(openfilestruct *fileptr) void unlink_opennode(openfilestruct *fileptr)
{ {
if (fileptr == firstfile) if (fileptr == startfile)
firstfile = firstfile->next; startfile = startfile->next;
fileptr->prev->next = fileptr->next; fileptr->prev->next = fileptr->next;
fileptr->next->prev = fileptr->prev; fileptr->next->prev = fileptr->prev;

View File

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

View File

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