From aeb49a8013d7636fd01a50a477e75670a4c4bc9a Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Sat, 27 Aug 2016 12:22:59 +0200
Subject: [PATCH] bottombar: only count help items that have a shortcut bound
 to them

This avoids showing a ghost item in, for example, the WriteOut menu
when not using --tempfile and the user does not bind 'discardbuffer'.
---
 src/global.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/global.c b/src/global.c
index da404d27..d16254de 100644
--- a/src/global.c
+++ b/src/global.c
@@ -230,9 +230,9 @@ size_t length_of_list(int menu)
     size_t i = 0;
 
     for (f = allfuncs; f != NULL; f = f->next)
-	if ((f->menus & menu) != 0) {
+	if ((f->menus & menu) && first_sc_for(menu, f->scfunc) != NULL)
 	    i++;
-	}
+
     return i;
 }
 
-- 
GitLab