diff -uNra gnome-commander-1.2.8.8-orig/src/gnome-cmd-file-list.cc gnome-commander-1.2.8.8-modified/src/gnome-cmd-file-list.cc --- gnome-commander-1.2.8.8-orig/src/gnome-cmd-file-list.cc 2010-09-09 05:41:13.000000000 +0800 +++ gnome-commander-1.2.8.8-modified/src/gnome-cmd-file-list.cc 2010-09-27 17:24:18.931000111 +0800 @@ -2222,6 +2222,75 @@ case GDK_Menu: show_file_popup_with_warp (this); return TRUE; + case GDK_0: + case GDK_1: + case GDK_2: + case GDK_3: + case GDK_4: + case GDK_5: + case GDK_6: + case GDK_7: + case GDK_8: + case GDK_9: + case GDK_a: + case GDK_b: + case GDK_c: + case GDK_d: + case GDK_e: + case GDK_f: + case GDK_g: + case GDK_h: + case GDK_i: + case GDK_j: + case GDK_k: + case GDK_l: + case GDK_m: + case GDK_n: + case GDK_o: + case GDK_p: + case GDK_q: + case GDK_r: + case GDK_s: + case GDK_t: + case GDK_u: + case GDK_v: + case GDK_w: + case GDK_x: + case GDK_y: + case GDK_z: + + + + + + case GDK_A: + case GDK_B: + case GDK_C: + case GDK_D: + case GDK_E: + case GDK_F: + case GDK_G: + case GDK_H: + case GDK_I: + case GDK_J: + case GDK_K: + case GDK_L: + case GDK_M: + case GDK_N: + case GDK_O: + case GDK_P: + case GDK_Q: + case GDK_R: + case GDK_S: + case GDK_T: + case GDK_U: + case GDK_V: + case GDK_W: + case GDK_X: + case GDK_Y: + case GDK_Z: + gnome_cmd_file_list_show_quicksearch (this, (gchar) + event->keyval); } } diff -uNra gnome-commander-1.2.8.8-orig/src/gnome-cmd-quicksearch-popup.cc gnome-commander-1.2.8.8-modified/src/gnome-cmd-quicksearch-popup.cc --- gnome-commander-1.2.8.8-orig/src/gnome-cmd-quicksearch-popup.cc 2010-09-09 05:41:13.000000000 +0800 +++ gnome-commander-1.2.8.8-modified/src/gnome-cmd-quicksearch-popup.cc 2010-09-27 17:27:23.600000005 +0800 @@ -73,26 +73,38 @@ popup->priv->matches = NULL; } - for (GList *files = popup->priv->fl->get_visible_files(); files; files = files->next) - { + for (GList *files = popup->priv->fl->get_visible_files(); files; files = files->next) { GnomeCmdFile *f = (GnomeCmdFile *) files->data; - gint res; + GRegex *reg; + GError *error = NULL; + gchar *formated = NULL; + GMatchInfo *match_info; - if (gnome_cmd_data.case_sens_sort) - res = strncmp (f->info->name, text, strlen(text)); + if (*text == '*') { + formated = g_strconcat(".", text, NULL); + } else - res = strncasecmp (f->info->name, text, strlen(text)); + formated = g_strdup(text); - if (res == 0) - { - if (first) - { + reg = g_regex_new(formated, G_REGEX_CASELESS, G_REGEX_MATCH_NOTEMPTY, &error); + + g_free(formated); + + if (error) { + g_print ("Code: %d, MSG: %s\n", error->code, error->message); + continue; + } + + + if (g_regex_match(reg, f->info->name, G_REGEX_MATCH_NOTEMPTY, + &match_info)) { + if (first) { focus_file (popup, f); first = FALSE; } - popup->priv->matches = g_list_append (popup->priv->matches, f); } + g_regex_unref(reg); } // If no file matches the new filter, focus on the last file that matched a previous filter