nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 43235c2f160be75e0c22f88c46ed4fcaf54010c3
parent b14ad451a9f9ca8bb3ac9a4db89c5cabda5c1f99
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri, 27 Sep 2019 19:07:25 +0200

tweaks: rename a function, to be a bit more fitting

Diffstat:
Msrc/global.c | 4++--
Msrc/proto.h | 2+-
Msrc/winio.c | 4++--
3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/global.c b/src/global.c @@ -428,8 +428,8 @@ int the_code_for(void (*func)(void), int defaultval) return s->keycode; } -/* Return the number of entries in the shortcut list for a given menu. */ -size_t length_of_list(int menu) +/* Return the number of entries that can be shown in the given menu. */ +size_t shown_entries_for(int menu) { funcstruct *item; size_t count = 0; diff --git a/src/proto.h b/src/proto.h @@ -319,7 +319,7 @@ char *input_tab(char *buf, bool allow_files, size_t *place, /* Some functions in global.c. */ const keystruct *first_sc_for(int menu, void (*func)(void)); int the_code_for(void (*func)(void), int defaultval); -size_t length_of_list(int menu); +size_t shown_entries_for(int menu); const keystruct *get_shortcut(int *kbinput); functionptrtype func_from_key(int *kbinput); int keycode_from_string(const char *keystring); diff --git a/src/winio.c b/src/winio.c @@ -1696,7 +1696,7 @@ int get_mouseinput(int *mouse_y, int *mouse_x, bool allow_shortcuts) } /* Determine how many shortcuts are being shown. */ - number = length_of_list(currmenu); + number = shown_entries_for(currmenu); /* Calculate the width of each non-rightmost shortcut item; * the rightmost ones will "absorb" any remaining slack. */ @@ -2293,7 +2293,7 @@ void bottombars(int menu) return; /* Determine how many shortcuts must be shown. */ - number = length_of_list(menu); + number = shown_entries_for(menu); /* Compute the width of each keyname-plus-explanation pair. */ itemwidth = COLS / ((number / 2) + (number % 2));