mirror of
git://git.sv.gnu.org/nano.git
synced 2025-02-16 21:34:26 +03:00
minibar: add an [x/y] "counter" when multiple files are open
This commit is contained in:
parent
b86f7868d1
commit
2b6c08b955
11
src/winio.c
11
src/winio.c
@ -2072,7 +2072,7 @@ void minibar(void)
|
||||
char *thisline = openfile->current->data;
|
||||
char *hexadecimal = nmalloc(9);
|
||||
char *location = nmalloc(44);
|
||||
char *thename;
|
||||
char *thename = NULL, *ranking = NULL;
|
||||
wchar_t widecode;
|
||||
|
||||
/* Draw a colored bar over the full width of the screen. */
|
||||
@ -2088,6 +2088,14 @@ void minibar(void)
|
||||
mvwaddstr(bottomwin, 0, 2, thename);
|
||||
waddstr(bottomwin, openfile->modified ? " *" : " ");
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
if (openfile->next != openfile) {
|
||||
ranking = nmalloc(24);
|
||||
sprintf(ranking, " [%i/%i]", buffer_number(openfile), buffer_number(startfile->prev));
|
||||
waddstr(bottomwin, ranking);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Display the line/column position of the cursor. */
|
||||
sprintf(location, "%zi,%lu", openfile->current->lineno, xplustabs() + 1);
|
||||
mvwaddstr(bottomwin, 0, COLS - 21 - strlen(location), location);
|
||||
@ -2114,6 +2122,7 @@ void minibar(void)
|
||||
free(hexadecimal);
|
||||
free(location);
|
||||
free(thename);
|
||||
free(ranking);
|
||||
}
|
||||
#endif /* NANO_TINY */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user