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

master
Benno Schulenberg 2021-10-10 10:11:47 +02:00
parent e9f0597e2e
commit 9c45b5da6c
3 changed files with 8 additions and 8 deletions

View File

@ -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;
}

View File

@ -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

View File

@ -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);