From 051c9ba41880b78541d1ba15816d213e81daaad8 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Tue, 22 Apr 2014 20:26:58 +0000
Subject: [PATCH] Splitting the toggles into three kind-of related groups, and
 not showing toggle keys that have been rebound.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4808 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog  | 2 ++
 src/help.c | 9 ++++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 570d0331..66d83923 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,8 @@
 	* src/global.c (shortcut_init): List function key after meta key.
 	* src/help.c (help_init): Show just two shortcuts per function --
 	only three functions showed three, but who has an F13, F14, F15?
+	* src/help.c (help_init): Split the toggles into three groups,
+	and do not show toggle keys that have been rebound.
 
 2014-04-21  Benno Schulenberg  <bensberg@justemail.net>
 	* doc/syntax/nanorc.nanorc: There is no F0 key.
diff --git a/src/help.c b/src/help.c
index 5f20e011..2d9768b3 100644
--- a/src/help.c
+++ b/src/help.c
@@ -463,10 +463,13 @@ void help_init(void)
 #ifndef NANO_TINY
     /* And the toggles... */
     if (currmenu == MMAIN)
-	for (s = sclist; s != NULL; s = s->next)
+	for (s = sclist; s != NULL; s = s->next) {
 	    if (s->scfunc == do_toggle_void)
-		ptr += sprintf(ptr, "(%s)\t\t%s %s\n",
-		    s->keystr, _(flagtostr(s->toggle)), _("enable/disable"));
+		ptr += sprintf(ptr, "%s\t\t%s %s\n", (s->menu == MMAIN ? s->keystr : ""),
+				 _(flagtostr(s->toggle)), _("enable/disable"));
+	    if (s->toggle == NO_COLOR_SYNTAX || s->toggle == TABS_TO_SPACES)
+		ptr += sprintf(ptr, "\n");
+	}
 
 #ifndef DISABLE_NANORC
     if (old_whitespace)
-- 
GitLab