Skip to content

Commit e5c8118

Browse files
committed
Make search result lists searchable
no pun indented
1 parent f7b395c commit e5c8118

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/uit_search.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,13 @@ static void result(search_r_t *r, void *dat) {
122122
}
123123

124124

125-
// Performs a seach and opens a new tab for the results.
125+
static const char *search_r_get_file(GSequenceIter *iter) {
126+
search_r_t *r = g_sequence_get(iter);
127+
return r->file;
128+
}
129+
130+
131+
// Performs a search and opens a new tab for the results.
126132
// May return NULL on error, behaves similarly to search_add() w.r.t *err.
127133
// Ownership of q is passed to the tab, and will be freed on error or close.
128134
ui_tab_t *uit_search_create(hub_t *hub, search_q_t *q, GError **err) {
@@ -157,7 +163,7 @@ ui_tab_t *uit_search_create(hub_t *hub, search_q_t *q, GError **err) {
157163
while(t->tab.name[strlen(t->tab.name)-1] == ' ')
158164
t->tab.name[strlen(t->tab.name)-1] = 0;
159165

160-
t->list = ui_listing_create(g_sequence_new(search_r_free), NULL, t, NULL);
166+
t->list = ui_listing_create(g_sequence_new(search_r_free), NULL, t, search_r_get_file);
161167
return (ui_tab_t *)t;
162168
}
163169

0 commit comments

Comments
 (0)