tweaks: replace a verbose condition with a simpler early return

master
Benno Schulenberg 2021-11-01 18:11:20 +01:00
parent fc5d58ad97
commit 13edbedc79
1 changed files with 7 additions and 6 deletions

View File

@ -1084,19 +1084,20 @@ void do_toggle(int flag)
#endif #endif
} }
if (!ISSET(MINIBAR) && ISSET(STATEFLAGS)) if (ISSET(STATEFLAGS) && (flag == AUTOINDENT ||
if (flag == AUTOINDENT || flag == BREAK_LONG_LINES || flag == SOFTWRAP) flag == BREAK_LONG_LINES || flag == SOFTWRAP)) {
if (ISSET(MINIBAR))
return;
else
titlebar(NULL); titlebar(NULL);
}
if (ISSET(MINIBAR) && (flag == NO_HELP || flag == LINE_NUMBERS)) if (ISSET(MINIBAR) && (flag == NO_HELP || flag == LINE_NUMBERS))
return; return;
if (flag == CONSTANT_SHOW) if (flag == CONSTANT_SHOW)
wipe_statusbar(); wipe_statusbar();
else if (!ISSET(MINIBAR) || !ISSET(STATEFLAGS) || flag == SMART_HOME || else {
flag == NO_SYNTAX || flag == WHITESPACE_DISPLAY ||
flag == CUT_FROM_CURSOR || flag == TABS_TO_SPACES ||
flag == USE_MOUSE) {
bool enabled = ISSET(flag); bool enabled = ISSET(flag);
if (flag == NO_HELP || flag == NO_SYNTAX) if (flag == NO_HELP || flag == NO_SYNTAX)