From b228c9fe6cc44855fe7670a0b2fa121d85346728 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 21 Nov 2021 17:00:41 +0100 Subject: [PATCH] tweaks: untangle two case items, and shorten a message Also, sort the case items in the order they are listed in the help text. --- src/nano.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/nano.c b/src/nano.c index 8a712e66..11e7a547 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1073,37 +1073,26 @@ void toggle_this(int flag) focusing = FALSE; switch (flag) { - case NO_HELP: case ZERO: window_init(); draw_all_subwindows(); - if (flag == ZERO) - return; + return; + case NO_HELP: + window_init(); + draw_all_subwindows(); break; case CONSTANT_SHOW: if (ISSET(ZERO) || LINES == 1) { - statusline(AHEM, _("Not possible in barless mode")); + statusline(AHEM, _("Not possible")); TOGGLE(flag); } else if (!ISSET(MINIBAR)) wipe_statusbar(); return; -#ifdef ENABLE_MOUSE - case USE_MOUSE: - mouse_init(); - break; -#endif case SOFTWRAP: if (!ISSET(SOFTWRAP)) openfile->firstcolumn = 0; refresh_needed = TRUE; break; - case TABS_TO_SPACES: - if (openfile->syntax && openfile->syntax->tab) { - statusline(AHEM, _("Current syntax determines Tab")); - TOGGLE(flag); - return; - } - break; case WHITESPACE_DISPLAY: titlebar(NULL); refresh_needed = TRUE; @@ -1113,6 +1102,18 @@ void toggle_this(int flag) precalc_multicolorinfo(); refresh_needed = TRUE; break; +#endif + case TABS_TO_SPACES: + if (openfile->syntax && openfile->syntax->tab) { + statusline(AHEM, _("Current syntax determines Tab")); + TOGGLE(flag); + return; + } + break; +#ifdef ENABLE_MOUSE + case USE_MOUSE: + mouse_init(); + break; #endif }