}
#endif
+ vb.mode->flags |= FLAG_COMPLETION;
+
/* this prevents the first item to be placed out of view if the completion
* is shown */
gtk_widget_show_all(comp.win);
void completion_clean(void)
{
+ vb.mode->flags &= ~FLAG_COMPLETION;
if (comp.win) {
gtk_widget_destroy(comp.win);
comp.win = comp.tree = NULL;
*/
void ex_leave(void)
{
- if (vb.mode->flags & FLAG_COMPLETION) {
- completion_clean();
- vb.mode->flags &= ~FLAG_COMPLETION;
- }
+ completion_clean();
hints_clear();
}
/* if direction is 0 stop the completion */
if (!direction) {
completion_clean();
- vb.mode->flags &= ~FLAG_COMPLETION;
return true;
}
/* if current input isn't the content of the completion item, stop
* completion and start it after that again */
completion_clean();
- vb.mode->flags &= ~FLAG_COMPLETION;
}
store = gtk_list_store_new(COMPLETION_STORE_NUM, G_TYPE_STRING, G_TYPE_STRING);
GTK_TREE_SORTABLE(store), COMPLETION_STORE_FIRST, GTK_SORT_ASCENDING
);
}
- if (found
- && completion_create(GTK_TREE_MODEL(store), completion_select, direction < 0)
- ) {
- /* set the submode flag */
- vb.mode->flags |= FLAG_COMPLETION;
+
+ if (found) {
+ completion_create(GTK_TREE_MODEL(store), completion_select, direction < 0);
}
g_free(input);