Clear the entry and use vte_terminal_feed_child.

vte_terminal_feed write to the underling vte while
vte_terminal_feed_child properly simulates keyboard input. The later
is needed, otherwise input can't be erased.
This commit is contained in:
Simon Gomizelj 2012-06-04 00:24:39 -04:00
parent cc8bb5224d
commit 586dff08ec
1 changed files with 3 additions and 7 deletions

View File

@ -72,8 +72,6 @@ static GtkTreeModel *create_completion_model(VteTerminal *vte) {
}
g_tree_foreach(tree, (GTraverseFunc)add_to_list_store, store);
g_tree_destroy(tree);
g_free(content);
return GTK_TREE_MODEL(store);
}
@ -108,7 +106,7 @@ static gboolean entry_key_press_cb(GtkEntry *entry, GdkEventKey *event, search_p
search(VTE_TERMINAL(info->vte), text, true);
break;
case OVERLAY_COMPLETION:
vte_terminal_feed(VTE_TERMINAL(info->vte), text, -1);
vte_terminal_feed_child(VTE_TERMINAL(info->vte), text, -1);
break;
case OVERLAY_HIDDEN:
break;
@ -137,6 +135,8 @@ static void overlay_show(search_panel_info *info, enum overlay_mode mode, bool c
gtk_entry_completion_set_text_column(completion, 0);
}
gtk_entry_set_text(GTK_ENTRY(info->entry), "");
info->mode = mode;
gtk_widget_show(GTK_WIDGET(info->panel));
gtk_widget_grab_focus(info->entry);
@ -177,10 +177,6 @@ static gboolean key_press_cb(VteTerminal *vte, GdkEventKey *event, search_panel_
overlay_show(info, OVERLAY_COMPLETION, true);
return TRUE;
}
if (modifiers == GDK_CONTROL_MASK && event->keyval == GDK_KEY_Tab) {
do_entry_completion(vte);
return TRUE;
}
return FALSE;
}