Renaming a variable to better indicate booleanness.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5779 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Benno Schulenberg 2016-03-30 12:27:06 +00:00
parent 29cac04afc
commit 532d73ccc7
4 changed files with 14 additions and 15 deletions

View File

@ -5,6 +5,8 @@
* src/winio.c (do_replace_highlight): Rename this to 'spotlight', * src/winio.c (do_replace_highlight): Rename this to 'spotlight',
for clarity, and for contrast with 'do_replace/do_replace_loop'. for clarity, and for contrast with 'do_replace/do_replace_loop'.
* src/winio.c (spotlight): Rename a variable for clarity. * src/winio.c (spotlight): Rename a variable for clarity.
* src/files.c (input_tab), src/prompt.c (get_prompt_string):
Rename a variable to better indicate booleanness.
2016-03-29 Benno Schulenberg <bensberg@justemail.net> 2016-03-29 Benno Schulenberg <bensberg@justemail.net>
* src/nano.c (main), src/text.c (do_justify, do_verbatim_input), * src/nano.c (main), src/text.c (do_justify, do_verbatim_input),

View File

@ -2793,15 +2793,15 @@ char **cwd_tab_completion(const char *buf, bool allow_files, size_t
* position should be advanced. refresh_func is the function we will * position should be advanced. refresh_func is the function we will
* call to refresh the edit window. */ * call to refresh the edit window. */
char *input_tab(char *buf, bool allow_files, size_t *place, bool char *input_tab(char *buf, bool allow_files, size_t *place, bool
*lastwastab, void (*refresh_func)(void), bool *list) *lastwastab, void (*refresh_func)(void), bool *listed)
{ {
size_t num_matches = 0, buf_len; size_t num_matches = 0, buf_len;
char **matches = NULL; char **matches = NULL;
assert(buf != NULL && place != NULL && *place <= strlen(buf) && assert(buf != NULL && place != NULL && *place <= strlen(buf) &&
lastwastab != NULL && refresh_func != NULL && list != NULL); lastwastab != NULL && refresh_func != NULL && listed != NULL);
*list = FALSE; *listed = FALSE;
/* If the word starts with `~' and there is no slash in the word, /* If the word starts with `~' and there is no slash in the word,
* then try completing this word as a username. */ * then try completing this word as a username. */
@ -2939,7 +2939,7 @@ char *input_tab(char *buf, bool allow_files, size_t *place, bool
} }
wnoutrefresh(edit); wnoutrefresh(edit);
*list = TRUE; *listed = TRUE;
} }
free(mzero); free(mzero);
@ -2949,7 +2949,7 @@ char *input_tab(char *buf, bool allow_files, size_t *place, bool
/* Only refresh the edit window if we don't have a list of filename /* Only refresh the edit window if we don't have a list of filename
* matches on it. */ * matches on it. */
if (!*list) if (!*listed)
refresh_func(); refresh_func();
return buf; return buf;

View File

@ -527,8 +527,7 @@ void update_bar_if_needed(void)
/* Get a string of input at the statusbar prompt. */ /* Get a string of input at the statusbar prompt. */
functionptrtype get_prompt_string(int *actual, bool allow_tabs, functionptrtype get_prompt_string(int *actual, bool allow_tabs,
#ifndef DISABLE_TABCOMP #ifndef DISABLE_TABCOMP
bool allow_files, bool allow_files, bool *listed,
bool *list,
#endif #endif
const char *curranswer, const char *curranswer,
#ifndef DISABLE_HISTORIES #ifndef DISABLE_HISTORIES
@ -618,7 +617,7 @@ functionptrtype get_prompt_string(int *actual, bool allow_tabs,
#endif #endif
if (allow_tabs) if (allow_tabs)
answer = input_tab(answer, allow_files, &statusbar_x, answer = input_tab(answer, allow_files, &statusbar_x,
&tabbed, refresh_func, list); &tabbed, refresh_func, listed);
update_the_statusbar(); update_the_statusbar();
} else } else
@ -742,7 +741,7 @@ int do_prompt(bool allow_tabs,
int retval; int retval;
functionptrtype func; functionptrtype func;
#ifndef DISABLE_TABCOMP #ifndef DISABLE_TABCOMP
bool list = FALSE; bool listed = FALSE;
#endif #endif
prompt = charalloc(((COLS - 4) * mb_cur_max()) + 1); prompt = charalloc(((COLS - 4) * mb_cur_max()) + 1);
@ -756,8 +755,7 @@ int do_prompt(bool allow_tabs,
func = get_prompt_string(&retval, allow_tabs, func = get_prompt_string(&retval, allow_tabs,
#ifndef DISABLE_TABCOMP #ifndef DISABLE_TABCOMP
allow_files, allow_files, &listed,
&list,
#endif #endif
curranswer, curranswer,
#ifndef DISABLE_HISTORIES #ifndef DISABLE_HISTORIES
@ -791,7 +789,7 @@ int do_prompt(bool allow_tabs,
/* If we've done tab completion, there might be a list of filename /* If we've done tab completion, there might be a list of filename
* matches on the edit window at this point. Make sure that they're * matches on the edit window at this point. Make sure that they're
* cleared off. */ * cleared off. */
if (list) if (listed)
refresh_func(); refresh_func();
#endif #endif

View File

@ -341,7 +341,7 @@ char **username_tab_completion(const char *buf, size_t *num_matches,
char **cwd_tab_completion(const char *buf, bool allow_files, size_t char **cwd_tab_completion(const char *buf, bool allow_files, size_t
*num_matches, size_t buf_len); *num_matches, size_t buf_len);
char *input_tab(char *buf, bool allow_files, size_t *place, bool char *input_tab(char *buf, bool allow_files, size_t *place, bool
*lastwastab, void (*refresh_func)(void), bool *list); *lastwastab, void (*refresh_func)(void), bool *listed);
#endif #endif
const char *tail(const char *foo); const char *tail(const char *foo);
#ifndef DISABLE_HISTORIES #ifndef DISABLE_HISTORIES
@ -532,8 +532,7 @@ void update_the_statusbar(void);
void update_bar_if_needed(void); void update_bar_if_needed(void);
functionptrtype get_prompt_string(int *value, bool allow_tabs, functionptrtype get_prompt_string(int *value, bool allow_tabs,
#ifndef DISABLE_TABCOMP #ifndef DISABLE_TABCOMP
bool allow_files, bool allow_files, bool *listed,
bool *list,
#endif #endif
const char *curranswer, const char *curranswer,
#ifndef DISABLE_HISTORIES #ifndef DISABLE_HISTORIES