From 5bd0cba16eade607ff6298e2ff8ab6511defca7c Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Thu, 2 Mar 2017 01:10:12 +0100 Subject: [PATCH] Added completion for shortcuts. Completion for shortcuts are now available for :shortcut-remove and :shortcut-default. --- src/ex.c | 5 +++-- src/shortcut.c | 4 +--- src/shortcut.h | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) 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 */ -- 2.20.1