nano

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

commit 7942dab01448d21efd4e8d205eee8801e8ea637d
parent 312bcebf4400046e02b65bd35a27d37afef4d0e8
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun,  2 Aug 2020 14:47:25 +0200

tweaks: make a misplaced call of statusline() more obvious by crashing

Also, reshuffle the lines, to take advantage of an other #ifndef.

Diffstat:
Msrc/winio.c | 12+++---------
1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/winio.c b/src/winio.c @@ -2043,6 +2043,9 @@ void statusline(message_type importance, const char *msg, ...) bool old_whitespace = ISSET(WHITESPACE_DISPLAY); UNSET(WHITESPACE_DISPLAY); + + if (isendwin()) + die("Out of curses -- please report a bug\n"); #endif /* Ignore a message with an importance that is lower than the last one. */ @@ -2050,15 +2053,6 @@ void statusline(message_type importance, const char *msg, ...) (lastmessage == MILD && importance == HUSH)) return; -#ifndef NANO_TINY - /* Curses mode shouldn't be off when trying to write to the status bar. */ - if (isendwin()) { - fprintf(stderr, "Out of curses -- please report a bug\n"); - napms(1400); - return; - } -#endif - /* If there are multiple alert messages, add trailing dots to the first. */ if (lastmessage == ALERT) { if (start_col > 4) {