Code

Define a tree_grep and fixing searching
authorJonas Fonseca <fonseca@diku.dk>
Tue, 17 Feb 2009 03:07:28 +0000 (04:07 +0100)
committerJonas Fonseca <fonseca@diku.dk>
Tue, 17 Feb 2009 11:55:23 +0000 (12:55 +0100)
It was broken by the move to the annotated tree view.

NEWS
tig.c

diff --git a/NEWS b/NEWS
index 58aafed3554ab75d04a3d58597fd9840399a10e1..eff874a7655dee2c201f5282c129274f3965c468 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,13 @@
 Release notes
 =============
 
+tig master
+---------
+
+Bug fixes:
+
+ - Tree view: fix searching.
+
 tig-0.14.1
 ----------
 
diff --git a/tig.c b/tig.c
index ec31d49c8fce1956550b10d586aac6c6a1c8af60..74be272a673cd1edb1a17643f4acb377231441e6 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -4143,6 +4143,20 @@ tree_request(struct view *view, enum request request, struct line *line)
        return REQ_NONE;
 }
 
+static bool
+tree_grep(struct view *view, struct line *line)
+{
+       struct tree_entry *entry = line->data;
+       const char *text[] = {
+               entry->name,
+               opt_author ? entry->author : "",
+               opt_date ? mkdate(&entry->time) : "",
+               NULL
+       };
+
+       return grep_text(view, text);
+}
+
 static void
 tree_select(struct view *view, struct line *line)
 {
@@ -4170,7 +4184,7 @@ static struct view_ops tree_ops = {
        tree_read,
        tree_draw,
        tree_request,
-       pager_grep,
+       tree_grep,
        tree_select,
 };