summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Carl <danielcarl@gmx.de>2017-03-02 01:10:12 +0100
committerDaniel Carl <danielcarl@gmx.de>2017-03-02 01:10:12 +0100
commit5bd0cba16eade607ff6298e2ff8ab6511defca7c (patch)
tree5c9fc37db21f332b7b3b1061caa9d502d3676878
parentaf741e150987c1e5ce04a0c6c875b7e629b3b48a (diff)
Added completion for shortcuts.
Completion for shortcuts are now available for :shortcut-remove and :shortcut-default.
-rw-r--r--src/ex.c5
-rw-r--r--src/shortcut.c4
-rw-r--r--src/shortcut.h2
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 */