From 2b335060b00ad53a2de44ff78653ba93c809d908 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sat, 6 Apr 2024 10:41:58 +0200 Subject: [PATCH] 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. --- src/files.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/files.c b/src/files.c index af236cfc..922b8f91 100644 --- 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);