nano

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

commit 2b335060b00ad53a2de44ff78653ba93c809d908
parent c3fc3ec73d37f51e95e71e7526ba9d74a2488e6e
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sat,  6 Apr 2024 10:41:58 +0200

feedback: suppress format-conversion messages for --zero and --mini

A "Read xx lines (converted from...)" message should be suppressed when
--zero or --minibar are active (just like the normal "Read xx lines"),
as otherwise it gets shown at a confusing moment when multiple files
are opened at the same time.  The message should get shown, however,
when inserting a file into the current buffer.

This fixes https://savannah.gnu.org/bugs/?65560.

Bug existed since version 6.0, commit f147131e.

Diffstat:
Msrc/files.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/files.c b/src/files.c @@ -830,6 +830,8 @@ void read_file(FILE *f, int fd, const char *filename, bool undoable) if (!writable) statusline(ALERT, _("File '%s' is unwritable"), filename); + else if ((ISSET(ZERO) || ISSET(MINIBAR)) && !(we_are_running && undoable)) + ; /* No blurb for new buffers with --zero or --mini. */ #ifndef NANO_TINY else if (format == MAC_FILE) /* TRANSLATORS: Keep the next three messages at most 78 characters. */ @@ -841,7 +843,7 @@ void read_file(FILE *f, int fd, const char *filename, bool undoable) "Read %zu lines (Converted from DOS format)", num_lines), num_lines); #endif - else if ((!ISSET(MINIBAR) && !ISSET(ZERO)) || (we_are_running && undoable)) + else statusline(REMARK, P_("Read %zu line", "Read %zu lines", num_lines), num_lines);