hellp: show all valid help items also in the Write-Out menu

Subtract one from the count only if all possible items in the menu
have been counted (item == NULL), meaning that the last item in the
Write-Out menu (the 'discard_buffer' function) has been counted too.

This fixes https://savannah.gnu.org/bugs/?59549.

Bug existed since version 4.5, commit b3ace4d8.
master
Benno Schulenberg 2020-11-26 15:27:36 +01:00
parent 63bb1b62b7
commit 13b839734f
1 changed files with 2 additions and 1 deletions

View File

@ -477,7 +477,8 @@ size_t shown_entries_for(int menu)
}
/* When --saveonexit is not used, widen the grid of the WriteOut menu. */
if (menu == MWRITEFILE && first_sc_for(menu, discard_buffer) == NULL)
if (menu == MWRITEFILE && item == NULL &&
first_sc_for(menu, discard_buffer) == NULL)
count--;
return count;