tweaks: replace a verbose condition with a simpler early return

This commit is contained in:
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
}
if (!ISSET(MINIBAR) && ISSET(STATEFLAGS))
if (flag == AUTOINDENT || flag == BREAK_LONG_LINES || flag == SOFTWRAP)
if (ISSET(STATEFLAGS) && (flag == AUTOINDENT ||
flag == BREAK_LONG_LINES || flag == SOFTWRAP)) {
if (ISSET(MINIBAR))
return;
else
titlebar(NULL);
}
if (ISSET(MINIBAR) && (flag == NO_HELP || flag == LINE_NUMBERS))
return;
if (flag == CONSTANT_SHOW)
wipe_statusbar();
else if (!ISSET(MINIBAR) || !ISSET(STATEFLAGS) || flag == SMART_HOME ||
flag == NO_SYNTAX || flag == WHITESPACE_DISPLAY ||
flag == CUT_FROM_CURSOR || flag == TABS_TO_SPACES ||
flag == USE_MOUSE) {
else {
bool enabled = ISSET(flag);
if (flag == NO_HELP || flag == NO_SYNTAX)