diff options
Diffstat (limited to 'src/cmdline.cpp')
-rw-r--r-- | src/cmdline.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/cmdline.cpp b/src/cmdline.cpp index 042cd6f..10e4a6b 100644 --- a/src/cmdline.cpp +++ b/src/cmdline.cpp @@ -39,6 +39,7 @@ #include "ring.h" #include "ioview.h" #include "goto.h" +#include "help.h" #include "undo.h" #include "symbols.h" #include "spawn.h" @@ -443,6 +444,34 @@ Cmdline::process_edit_cmd(gchar key) interface.popup_clear(); insert(key); } + } else if (States::is_qreg()) { + if (interface.popup_is_shown()) { + /* cycle through popup pages */ + interface.popup_show(); + break; + } + + QRegSpecMachine &machine = ((StateExpectQReg *)States::current)->machine; + gchar *new_chars = machine.auto_complete(); + + if (new_chars) + insert(new_chars); + g_free(new_chars); + } else if (States::is_string() && + ((StateExpectString *)States::current)->machine.qregspec_machine) { + if (interface.popup_is_shown()) { + /* cycle through popup pages */ + interface.popup_show(); + break; + } + + QRegSpecMachine *machine = + ((StateExpectString *)States::current)->machine.qregspec_machine; + gchar *new_chars = machine->auto_complete(); + + if (new_chars) + insert(new_chars); + g_free(new_chars); } else if (States::is_insertion() && !interface.ssm(SCI_GETUSETABS)) { interface.popup_clear(); @@ -514,6 +543,32 @@ Cmdline::process_edit_cmd(gchar key) if (new_chars) insert(new_chars); g_free(new_chars); + } else if (States::current == &States::gotocmd) { + if (interface.popup_is_shown()) { + /* cycle through popup pages */ + interface.popup_show(); + break; + } + + const gchar *label = last_occurrence(strings[0], ","); + gchar *new_chars = Goto::table->auto_complete(label); + + if (new_chars) + insert(new_chars); + g_free(new_chars); + } else if (States::current == &States::gethelp) { + if (interface.popup_is_shown()) { + /* cycle through popup pages */ + interface.popup_show(); + break; + } + + gchar complete = escape_char == '{' ? '\0' : escape_char; + gchar *new_chars = help_index.auto_complete(strings[0], complete); + + if (new_chars) + insert(new_chars); + g_free(new_chars); } else { interface.popup_clear(); insert(key); |