diff options
author | portix <portix@gmx.net> | 2011-01-02 14:42:12 +0100 |
---|---|---|
committer | portix <portix@gmx.net> | 2011-01-02 14:42:12 +0100 |
commit | f6480ba5fb1ca3e7600ec692d47881d71ab45ec8 (patch) | |
tree | 1ef32f184fafe85ddfa2b8a322083e0fa6f98d94 /src/completion.c | |
parent | 190e192cd559e61073028cd09fe6877bb232e8b0 (diff) | |
download | dwb-f6480ba5fb1ca3e7600ec692d47881d71ab45ec8.zip |
Complete by type
Diffstat (limited to 'src/completion.c')
-rw-r--r-- | src/completion.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/completion.c b/src/completion.c index 83cb7f80..f00c31dd 100644 --- a/src/completion.c +++ b/src/completion.c @@ -258,18 +258,21 @@ dwb_comp_get_key_completion(gboolean entry) { /* dwb_comp_complete {{{*/ void -dwb_comp_complete(int back) { +dwb_comp_complete(CompletionType type, int back) { View *v = CURRENT_VIEW(); if ( !(dwb.state.mode & CompletionMode) ) { v->compbox = gtk_vbox_new(true, 0); gtk_box_pack_end(GTK_BOX(v->bottombox), v->compbox, false, false, 0); - switch (dwb.state.mode) { - case SettingsMode: dwb.comps.completions = dwb_comp_get_settings_completion(); break; - case KeyMode: dwb.comps.completions = dwb_comp_get_key_completion(true); break; - case CommandMode: dwb.comps.completions = dwb_comp_get_key_completion(false); break; - case BookmarksMode: dwb.comps.completions = dwb_comp_get_simple_completion(dwb.fc.bookmarks); break; - case UserscriptMode: dwb.comps.completions = dwb_comp_get_simple_completion(dwb.misc.userscripts); break; - default: dwb.comps.completions = dwb_comp_get_normal_completion(); break; + switch (type) { + case COMP_SETTINGS: dwb.comps.completions = dwb_comp_get_settings_completion(); break; + case COMP_KEY: dwb.comps.completions = dwb_comp_get_key_completion(true); break; + case COMP_COMMAND: dwb.comps.completions = dwb_comp_get_key_completion(false); break; + case COMP_BOOKMARK: dwb.comps.completions = dwb_comp_get_simple_completion(dwb.fc.bookmarks); break; + case COMP_HISTORY: dwb.comps.completions = dwb_comp_get_simple_completion(dwb.fc.history); break; + case COMP_USERSCRIPT: dwb.comps.completions = dwb_comp_get_simple_completion(dwb.misc.userscripts); break; + case COMP_INPUT: dwb.comps.completions = dwb_comp_get_simple_completion(dwb.fc.commands); break; + case COMP_SEARCH: dwb.comps.completions = dwb_comp_get_simple_completion(dwb.fc.se_completion); break; + default: dwb.comps.completions = dwb_comp_get_normal_completion(); break; } if (!dwb.comps.completions) { return; |