check response_id in search_response_cb
This commit is contained in:
parent
72aecb23f0
commit
a1768c4094
18
term.c
18
term.c
|
@ -18,15 +18,17 @@ typedef struct search_dialog_info {
|
||||||
} search_dialog_info;
|
} search_dialog_info;
|
||||||
|
|
||||||
static void search_response_cb(GtkDialog *dialog, gint response_id, search_dialog_info *info) {
|
static void search_response_cb(GtkDialog *dialog, gint response_id, search_dialog_info *info) {
|
||||||
GRegex *regex = vte_terminal_search_get_gregex(VTE_TERMINAL(info->vte));
|
if (response_id == GTK_RESPONSE_ACCEPT) {
|
||||||
if (regex) g_regex_unref(regex);
|
GRegex *regex = vte_terminal_search_get_gregex(VTE_TERMINAL(info->vte));
|
||||||
regex = g_regex_new(gtk_entry_get_text(GTK_ENTRY(info->entry)), 0, 0, NULL);
|
if (regex) g_regex_unref(regex);
|
||||||
vte_terminal_search_set_gregex(VTE_TERMINAL(info->vte), regex);
|
regex = g_regex_new(gtk_entry_get_text(GTK_ENTRY(info->entry)), 0, 0, NULL);
|
||||||
|
vte_terminal_search_set_gregex(VTE_TERMINAL(info->vte), regex);
|
||||||
|
|
||||||
if (info->direction == search_forward) {
|
if (info->direction == search_forward) {
|
||||||
vte_terminal_search_find_next(VTE_TERMINAL(info->vte));
|
vte_terminal_search_find_next(VTE_TERMINAL(info->vte));
|
||||||
} else {
|
} else {
|
||||||
vte_terminal_search_find_previous(VTE_TERMINAL(info->vte));
|
vte_terminal_search_find_previous(VTE_TERMINAL(info->vte));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
free(info);
|
free(info);
|
||||||
|
|
Loading…
Reference in New Issue