mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 12:23:37 +02:00
/BIND meta-k erase_completion - support for removing completion data.
Currently this works only with /MSG completion, so eg. /MSG nick <meta-k> removes nick from completion list and jumps to next completion. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2407 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
62028ad487
commit
3990779dc5
4 changed files with 132 additions and 20 deletions
|
|
@ -402,14 +402,15 @@ static void key_change_window(const char *data)
|
|||
signal_emit("command window goto", 3, data, active_win->active_server, active_win->active);
|
||||
}
|
||||
|
||||
static void key_word_completion(void)
|
||||
static void key_completion(int erase)
|
||||
{
|
||||
char *line;
|
||||
int pos;
|
||||
|
||||
pos = gui_entry_get_pos(active_entry);
|
||||
|
||||
line = word_complete(active_win, gui_entry_get_text(active_entry), &pos);
|
||||
line = word_complete(active_win, gui_entry_get_text(active_entry),
|
||||
&pos, erase);
|
||||
if (line != NULL) {
|
||||
gui_entry_set_text(active_entry, line);
|
||||
gui_entry_set_pos(active_entry, pos);
|
||||
|
|
@ -417,6 +418,16 @@ static void key_word_completion(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void key_word_completion(void)
|
||||
{
|
||||
key_completion(FALSE);
|
||||
}
|
||||
|
||||
static void key_erase_completion(void)
|
||||
{
|
||||
key_completion(TRUE);
|
||||
}
|
||||
|
||||
static void key_check_replaces(void)
|
||||
{
|
||||
char *line;
|
||||
|
|
@ -634,6 +645,7 @@ void gui_readline_init(void)
|
|||
/* line transmitting */
|
||||
key_bind("send_line", "Execute the input line", "return", NULL, (SIGNAL_FUNC) key_send_line);
|
||||
key_bind("word_completion", "", "^I", NULL, (SIGNAL_FUNC) key_word_completion);
|
||||
key_bind("erase_completion", "", "meta-k", NULL, (SIGNAL_FUNC) key_erase_completion);
|
||||
key_bind("check_replaces", "Check word replaces", NULL, NULL, (SIGNAL_FUNC) key_check_replaces);
|
||||
|
||||
/* window managing */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue