nano

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

commit 3638fb9da48188bca49c409d3ac3a4be9f9a300d
parent 2fc1f085730292a2f889551a0b960146bf4b8f63
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Wed, 24 Nov 2021 10:40:05 +0100

tweaks: place the unsetting of a flag better, and rename a variable

The unsetting should happen after the three possible early returns,
to avoid leaving the flag unset.

Also, don't bother to exclude the setting and unsetting from the
tiny version, to get rid of some cluttering conditionals.

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

diff --git a/src/winio.c b/src/winio.c @@ -2243,11 +2243,7 @@ void statusline(message_type importance, const char *msg, ...) char *compound, *message; static size_t start_col = 0; bool bracketed; -#ifndef NANO_TINY - bool old_whitespace = ISSET(WHITESPACE_DISPLAY); - - UNSET(WHITESPACE_DISPLAY); -#endif + bool showed_whitespace = ISSET(WHITESPACE_DISPLAY); /* Ignore a message with an importance that is lower than the last one. */ if (importance < lastmessage && lastmessage > NOTICE) @@ -2306,6 +2302,8 @@ void statusline(message_type importance, const char *msg, ...) blank_statusbar(); + UNSET(WHITESPACE_DISPLAY); + message = display_string(compound, 0, COLS, FALSE, FALSE); free(compound); @@ -2331,10 +2329,8 @@ void statusline(message_type importance, const char *msg, ...) wrefresh(bottomwin); free(message); -#ifndef NANO_TINY - if (old_whitespace) + if (showed_whitespace) SET(WHITESPACE_DISPLAY); -#endif /* When requested, wipe the status bar after just one keystroke. */ statusblank = (ISSET(QUICK_BLANK) ? 1 : 20);