diff options
author | James Booth <boothj5@gmail.com> | 2014-07-09 20:23:47 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-07-09 20:23:47 +0100 |
commit | 954661e59e7cfc994c93f08b5b9694286b00adc5 (patch) | |
tree | 62b83fd85f8b1277d7a4cc4991cb728702abe925 /src/tools | |
parent | 0c9851106bfac4693920fa81633740dc85ae743a (diff) | |
download | profani-tty-954661e59e7cfc994c93f08b5b9694286b00adc5.tar.gz |
Added quote param to autocomplete_complete
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/autocomplete.c | 10 | ||||
-rw-r--r-- | src/tools/autocomplete.h | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/tools/autocomplete.c b/src/tools/autocomplete.c index 668d78af..288548c8 100644 --- a/src/tools/autocomplete.c +++ b/src/tools/autocomplete.c @@ -148,7 +148,7 @@ autocomplete_contains(Autocomplete ac, const char *value) } gchar * -autocomplete_complete(Autocomplete ac, gchar *search_str) +autocomplete_complete(Autocomplete ac, gchar *search_str, gboolean quote) { gchar *found = NULL; @@ -166,18 +166,18 @@ autocomplete_complete(Autocomplete ac, gchar *search_str) FREE_SET_NULL(ac->search_str); } ac->search_str = strdup(search_str); - found = _search_from(ac, ac->items, TRUE); + found = _search_from(ac, ac->items, quote); return found; // subsequent search attempt } else { // search from here+1 tp end - found = _search_from(ac, g_slist_next(ac->last_found), TRUE); + found = _search_from(ac, g_slist_next(ac->last_found), quote); if (found != NULL) return found; // search from beginning - found = _search_from(ac, ac->items, TRUE); + found = _search_from(ac, ac->items, quote); if (found != NULL) return found; @@ -235,7 +235,7 @@ autocomplete_param_with_ac(char *input, int *size, char *command, } inp_cpy[(*size) - len] = '\0'; - char *found = autocomplete_complete(ac, inp_cpy); + char *found = autocomplete_complete(ac, inp_cpy, TRUE); if (found != NULL) { auto_msg = g_string_new(command_cpy); g_string_append(auto_msg, found); diff --git a/src/tools/autocomplete.h b/src/tools/autocomplete.h index 3736ef5f..6aaa607f 100644 --- a/src/tools/autocomplete.h +++ b/src/tools/autocomplete.h @@ -41,7 +41,7 @@ void autocomplete_add(Autocomplete ac, const char *item); void autocomplete_remove(Autocomplete ac, const char * const item); // find the next item prefixed with search string -gchar * autocomplete_complete(Autocomplete ac, gchar *search_str); +gchar * autocomplete_complete(Autocomplete ac, gchar *search_str, gboolean quote); GSList * autocomplete_get_list(Autocomplete ac); gint autocomplete_length(Autocomplete ac); |