minibar: add an [x/y] "counter" when multiple files are open
Этот коммит содержится в:
родитель
b86f7868d1
Коммит
2b6c08b955
11
src/winio.c
11
src/winio.c
@ -2072,7 +2072,7 @@ void minibar(void)
|
|||||||
char *thisline = openfile->current->data;
|
char *thisline = openfile->current->data;
|
||||||
char *hexadecimal = nmalloc(9);
|
char *hexadecimal = nmalloc(9);
|
||||||
char *location = nmalloc(44);
|
char *location = nmalloc(44);
|
||||||
char *thename;
|
char *thename = NULL, *ranking = NULL;
|
||||||
wchar_t widecode;
|
wchar_t widecode;
|
||||||
|
|
||||||
/* Draw a colored bar over the full width of the screen. */
|
/* Draw a colored bar over the full width of the screen. */
|
||||||
@ -2088,6 +2088,14 @@ void minibar(void)
|
|||||||
mvwaddstr(bottomwin, 0, 2, thename);
|
mvwaddstr(bottomwin, 0, 2, thename);
|
||||||
waddstr(bottomwin, openfile->modified ? " *" : " ");
|
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. */
|
/* Display the line/column position of the cursor. */
|
||||||
sprintf(location, "%zi,%lu", openfile->current->lineno, xplustabs() + 1);
|
sprintf(location, "%zi,%lu", openfile->current->lineno, xplustabs() + 1);
|
||||||
mvwaddstr(bottomwin, 0, COLS - 21 - strlen(location), location);
|
mvwaddstr(bottomwin, 0, COLS - 21 - strlen(location), location);
|
||||||
@ -2114,6 +2122,7 @@ void minibar(void)
|
|||||||
free(hexadecimal);
|
free(hexadecimal);
|
||||||
free(location);
|
free(location);
|
||||||
free(thename);
|
free(thename);
|
||||||
|
free(ranking);
|
||||||
}
|
}
|
||||||
#endif /* NANO_TINY */
|
#endif /* NANO_TINY */
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user