From: Daniel Carl Date: Thu, 2 Mar 2017 00:10:12 +0000 (+0100) Subject: Added completion for shortcuts. X-Git-Url: https://git.owens.tech/assets/me.webp/assets/me.webp/git?a=commitdiff_plain;h=5bd0cba16eade607ff6298e2ff8ab6511defca7c;p=vimb.git Added completion for shortcuts. Completion for shortcuts are now available for :shortcut-remove and :shortcut-default. --- diff --git a/src/ex.c b/src/ex.c index eaa97cb..cc4bdbe 100644 --- a/src/ex.c +++ b/src/ex.c @@ -1179,8 +1179,9 @@ static gboolean complete(Client *c, short direction) found = bookmark_fill_tag_completion(store, token); break; - case EX_SCR: - /* TODO fill shortcut completion */ + case EX_SCR: /* Fallthrough */ + case EX_SCD: + found = shortcut_fill_completion(c, store, token); break; case EX_HANDREM: diff --git a/src/shortcut.c b/src/shortcut.c index 7545037..af858ab 100644 --- a/src/shortcut.c +++ b/src/shortcut.c @@ -157,8 +157,7 @@ char *shortcut_get_uri(Client *c, const char *string) return uri; } -#if 0 -gboolean shortcut_fill_completion(GtkListStore *store, const char *input) +gboolean shortcut_fill_completion(Client *c, GtkListStore *store, const char *input) { GList *src = g_hash_table_get_keys(c->shortcut.table); gboolean found = util_fill_completion(store, input, src); @@ -166,7 +165,6 @@ gboolean shortcut_fill_completion(GtkListStore *store, const char *input) return found; } -#endif /** * Retrieves th highest placeholder number used in given string. diff --git a/src/shortcut.h b/src/shortcut.h index 9b44e29..21e21ff 100644 --- a/src/shortcut.h +++ b/src/shortcut.h @@ -26,7 +26,7 @@ gboolean shortcut_add(Client *c, const char *key, const char *uri); gboolean shortcut_remove(Client *c, const char *key); gboolean shortcut_set_default(Client *c, const char *key); char *shortcut_get_uri(Client *c, const char *key); -/*gboolean shortcut_fill_completion(Client *c, GtkListStore *store, const char *input);*/ +gboolean shortcut_fill_completion(Client *c, GtkListStore *store, const char *input); #endif /* end of include guard: _SHORTCUT_H */