tweaks: rename two parameters, to be more fitting

master
Benno Schulenberg 2020-06-18 19:12:11 +02:00
parent 78f54523d9
commit 287718cf8b
3 changed files with 11 additions and 11 deletions

View File

@ -2407,7 +2407,7 @@ char **username_completion(const char *buf, size_t length, size_t *num_matches)
/* Try to complete the given fragment in 'buf' to a filename. */
char **filename_completion(const char *buf, size_t length,
bool allow_files, size_t *num_matches)
bool only_folders, size_t *num_matches)
{
char *dirname = copy_of(buf);
char *slash, *filename;
@ -2463,7 +2463,7 @@ char **filename_completion(const char *buf, size_t length,
continue;
}
#endif
if (!allow_files && !is_dir(fullname)) {
if (only_folders && !is_dir(fullname)) {
free(fullname);
continue;
}
@ -2483,7 +2483,7 @@ char **filename_completion(const char *buf, size_t length,
/* Do tab completion. 'place' is the position of the status-bar cursor, and
* 'refresh_func' is the function to be called to refresh the edit window. */
char *input_tab(char *buf, size_t *place, bool allow_files,
char *input_tab(char *buf, size_t *place, bool only_folders,
bool *lastwastab, void (*refresh_func)(void), bool *listed)
{
size_t num_matches = 0;
@ -2505,7 +2505,7 @@ char *input_tab(char *buf, size_t *place, bool allow_files,
/* If there are no matches yet, try matching against filenames
* in the current directory. */
if (matches == NULL)
matches = filename_completion(buf, *place, allow_files, &num_matches);
matches = filename_completion(buf, *place, only_folders, &num_matches);
if (num_matches == 0)
beep();

View File

@ -403,7 +403,7 @@ void add_or_remove_pipe_symbol_from_answer(void)
#endif
/* Get a string of input at the status-bar prompt. */
functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
functionptrtype acquire_an_answer(int *actual, bool allow_tabbing,
bool allow_files, bool *listed, linestruct **history_list,
void (*refresh_func)(void))
{
@ -470,8 +470,8 @@ functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
}
} else
#endif
if (allow_tabs)
answer = input_tab(answer, &typing_x, allow_files,
if (allow_tabbing)
answer = input_tab(answer, &typing_x, !allow_files,
&tabbed, refresh_func, listed);
} else
#endif /* ENABLE_TABCOMP */
@ -552,11 +552,11 @@ functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
* -1 for a cancelled entry, -2 for a blank string, and the relevant
* keycode when a valid shortcut key was pressed.
*
* The allow_tabs parameter indicates whether tab completion is allowed,
* The allow_tabbing parameter indicates whether tab completion is allowed,
* and allow_files indicates whether all files (and not just directories)
* can be tab completed. The 'provided' parameter is the default answer
* for when simply Enter is typed. */
int do_prompt(bool allow_tabs, bool allow_files,
int do_prompt(bool allow_tabbing, bool allow_files,
int menu, const char *provided, linestruct **history_list,
void (*refresh_func)(void), const char *msg, ...)
{
@ -585,7 +585,7 @@ int do_prompt(bool allow_tabs, bool allow_files,
lastmessage = VACUUM;
func = acquire_an_answer(&retval, allow_tabs, allow_files, &listed,
func = acquire_an_answer(&retval, allow_tabbing, allow_files, &listed,
history_list, refresh_func);
free(prompt);
prompt = saved_prompt;

View File

@ -323,7 +323,7 @@ char *real_dir_from_tilde(const char *buf);
int diralphasort(const void *va, const void *vb);
#endif
#ifdef ENABLE_TABCOMP
char *input_tab(char *buf, size_t *place, bool allow_files,
char *input_tab(char *buf, size_t *place, bool only_folders,
bool *lastwastab, void (*refresh_func)(void), bool *listed);
#endif