From 3638fb9da48188bca49c409d3ac3a4be9f9a300d Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 24 Nov 2021 10:40:05 +0100 Subject: [PATCH] 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. --- src/winio.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/winio.c b/src/winio.c index c06b125e..fc20856c 100644 --- 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);