diff options
author | James Booth <boothj5@gmail.com> | 2017-04-01 00:27:11 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2017-04-01 00:27:11 +0100 |
commit | 6b830277a6e2f90c7f8fde94ccf31dc6a4e4e73e (patch) | |
tree | 4b99ba6b6d48c51bce6dfa6f8dbb30e1f4501832 /src/plugins | |
parent | 1b9d033cef78365ca73ac504041ce129fdf334d2 (diff) | |
download | profani-tty-6b830277a6e2f90c7f8fde94ccf31dc6a4e4e73e.tar.gz |
Allow previous autocompletion with shift tab
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/autocompleters.c | 6 | ||||
-rw-r--r-- | src/plugins/autocompleters.h | 2 | ||||
-rw-r--r-- | src/plugins/plugins.c | 4 | ||||
-rw-r--r-- | src/plugins/plugins.h | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/autocompleters.c b/src/plugins/autocompleters.c index 1f0d3c4c..20abaddf 100644 --- a/src/plugins/autocompleters.c +++ b/src/plugins/autocompleters.c @@ -129,7 +129,7 @@ autocompleters_filepath_add(const char *const plugin_name, const char *prefix) } char* -autocompleters_complete(const char * const input) +autocompleters_complete(const char * const input, gboolean previous) { char *result = NULL; @@ -141,7 +141,7 @@ autocompleters_complete(const char * const input) GList *keys = g_hash_table_get_keys(key_to_ac); GList *curr = keys; while (curr) { - result = autocomplete_param_with_ac(input, curr->data, g_hash_table_lookup(key_to_ac, curr->data), TRUE); + result = autocomplete_param_with_ac(input, curr->data, g_hash_table_lookup(key_to_ac, curr->data), TRUE, previous); if (result) { g_list_free(ac_hashes); g_list_free(keys); @@ -164,7 +164,7 @@ autocompleters_complete(const char * const input) while (curr_prefix) { char *prefix = curr_prefix->data; if (g_str_has_prefix(input, prefix)) { - result = cmd_ac_complete_filepath(input, prefix); + result = cmd_ac_complete_filepath(input, prefix, previous); if (result) { g_list_free(filepath_hashes); g_list_free(prefixes); diff --git a/src/plugins/autocompleters.h b/src/plugins/autocompleters.h index 2d6b072d..37539e27 100644 --- a/src/plugins/autocompleters.h +++ b/src/plugins/autocompleters.h @@ -42,7 +42,7 @@ void autocompleters_add(const char *const plugin_name, const char *key, char **i void autocompleters_remove(const char *const plugin_name, const char *key, char **items); void autocompleters_clear(const char *const plugin_name, const char *key); void autocompleters_filepath_add(const char *const plugin_name, const char *prefix); -char* autocompleters_complete(const char * const input); +char* autocompleters_complete(const char * const input, gboolean previous); void autocompleters_reset(void); void autocompleters_destroy(void); diff --git a/src/plugins/plugins.c b/src/plugins/plugins.c index 92d605e8..06b1417f 100644 --- a/src/plugins/plugins.c +++ b/src/plugins/plugins.c @@ -369,9 +369,9 @@ plugins_loaded_list(void) } char * -plugins_autocomplete(const char * const input) +plugins_autocomplete(const char * const input, gboolean previous) { - return autocompleters_complete(input); + return autocompleters_complete(input, previous); } void diff --git a/src/plugins/plugins.h b/src/plugins/plugins.h index af659757..0aa490f0 100644 --- a/src/plugins/plugins.h +++ b/src/plugins/plugins.h @@ -108,7 +108,7 @@ typedef struct prof_plugin_t { void plugins_init(void); GSList *plugins_unloaded_list(void); GList *plugins_loaded_list(void); -char* plugins_autocomplete(const char *const input); +char* plugins_autocomplete(const char *const input, gboolean previous); void plugins_reset_autocomplete(void); void plugins_shutdown(void); |