nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit fe4f74f631a9cfbb0303e36022c96108e2e43b33
parent 2b335060b00ad53a2de44ff78653ba93c809d908
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sat,  6 Apr 2024 12:17:27 +0200

minibar: mention the file format when it's DOS or Mac

This provides feedback about the file format in a better way than
how it was done until the previous commit.

Diffstat:
Msrc/winio.c | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/winio.c b/src/winio.c @@ -2215,8 +2215,12 @@ void minibar(void) if (report_size && COLS > 35) { size_t count = openfile->filebot->lineno - (openfile->filebot->data[0] == '\0'); - number_of_lines = nmalloc(44); - sprintf(number_of_lines, P_(" (%zu line)", " (%zu lines)", count), count); + number_of_lines = nmalloc(49); + if (openfile->fmt == NIX_FILE) + sprintf(number_of_lines, P_(" (%zu line)", " (%zu lines)", count), count); + else + sprintf(number_of_lines, P_(" (%zu line, %s)", " (%zu lines, %s)", count), + count, (openfile->fmt == DOS_FILE) ? "DOS" : "Mac"); tallywidth = breadth(number_of_lines); if (namewidth + tallywidth + 11 < COLS) waddstr(footwin, number_of_lines);