nano

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

commit 844f95e6df94be0bfd82a6b053b6afbd1a2dfc18
parent 67d22f4cced4dc6913ffb502aae86f5aa043dc3f
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sat,  1 Aug 2020 20:38:29 +0200

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.

Diffstat:
Msrc/text.c | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git 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;