The text used for searches is no longer the same as the text displayed, this allows for a lot more powerful searching especially in drun mode

This commit is contained in:
Scoopta
2019-10-28 14:17:06 -07:00
parent 84ffcb589d
commit da56f43d57
5 changed files with 30 additions and 23 deletions

View File

@@ -24,8 +24,10 @@ void run_init() {
struct cache_line* node, *tmp;
wl_list_for_each_safe(node, tmp, cache, link) {
char* text = strrchr(node->line, '/') + 1;
wofi_insert_widget(text, node->line);
char* search_text = utils_concat(2, text, node->line);
wofi_insert_widget(text, search_text, node->line);
map_put(cached, node->line, "true");
free(search_text);
free(node->line);
wl_list_remove(&node->link);
free(node);
@@ -50,7 +52,9 @@ void run_init() {
struct stat info;
stat(full_path, &info);
if(access(full_path, X_OK) == 0 && S_ISREG(info.st_mode) && !map_contains(cached, full_path)) {
wofi_insert_widget(entry->d_name, full_path);
char* search_text = utils_concat(2, entry->d_name, full_path);
wofi_insert_widget(entry->d_name, search_text, full_path);
free(search_text);
}
free(full_path);
}