nano

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

commit 9c45b5da6c191f2994a45b7e78398cbc021b381e
parent e9f0597e2efa9515176d7d3472604463e512b91f
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun, 10 Oct 2021 10:11:47 +0200

tweaks: rename a function and its parameter, to be clearer

Diffstat:
Msrc/history.c | 10+++++-----
Msrc/prompt.c | 4++--
Msrc/prototypes.h | 2+-
3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/history.c b/src/history.c @@ -63,14 +63,14 @@ void history_init(void) executebot = execute_history; } -/* Set the current position in the given history list to the bottom. */ -void history_reset(const linestruct *list) +/* Reset the pointer into the history list that contains item to the bottom. */ +void reset_history_pointer_for(const linestruct *item) { - if (list == search_history) + if (item == search_history) search_history = searchbot; - else if (list == replace_history) + else if (item == replace_history) replace_history = replacebot; - else if (list == execute_history) + else if (item == execute_history) execute_history = executebot; } diff --git a/src/prompt.c b/src/prompt.c @@ -456,7 +456,7 @@ functionptrtype acquire_an_answer(int *actual, bool *listed, #endif if (history_list != NULL) - history_reset(*history_list); + reset_history_pointer_for(*history_list); #endif /* ENABLE_HISTORIES */ if (typing_x > strlen(answer)) @@ -568,7 +568,7 @@ functionptrtype acquire_an_answer(int *actual, bool *listed, #ifdef ENABLE_HISTORIES /* Put the history pointer back at the bottom of the list. */ if (history_list != NULL) { - history_reset(*history_list); + reset_history_pointer_for(*history_list); free(magichistory); } #endif diff --git a/src/prototypes.h b/src/prototypes.h @@ -334,7 +334,7 @@ void do_help(void); /* Most functions in history.c. */ #ifdef ENABLE_HISTORIES void history_init(void); -void history_reset(const linestruct *list); +void reset_history_pointer_for(const linestruct *list); void update_history(linestruct **item, const char *text); #ifdef ENABLE_TABCOMP char *get_history_completion(linestruct **h, char *s, size_t len);