From 844f95e6df94be0bfd82a6b053b6afbd1a2dfc18 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sat, 1 Aug 2020 20:38:29 +0200 Subject: [PATCH] speller: give proper feedback when the user tries to check emptiness (The wording is general, because it should cover also the formatter.) This fixes https://savannah.gnu.org/bugs/?58865. Bug existed since version 4.6, commit d2fb371f. --- src/text.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/text.c b/src/text.c index 9f0cbe70..358fe632 100644 --- a/src/text.c +++ b/src/text.c @@ -2104,8 +2104,13 @@ void treat(char *tempfile_name, char *theprogram, bool spelling) /* Stat the temporary file. If that succeeds and its size is zero, * there is nothing to do; otherwise, store its time of modification. */ if (stat(tempfile_name, &fileinfo) == 0) { - if (fileinfo.st_size == 0) + if (fileinfo.st_size == 0) { + if (spelling && openfile->mark) + statusline(ALERT, _("Selection is empty")); + else + statusbar(_("Buffer is empty")); return; + } timestamp_sec = (long)fileinfo.st_mtim.tv_sec; timestamp_nsec = (long)fileinfo.st_mtim.tv_nsec;