]> git.neil.brown.name Git - edlib.git/commitdiff
Pass pane to doc_set_attr instead of using pt->doc;
authorNeilBrown <neil@brown.name>
Thu, 26 Nov 2015 22:35:18 +0000 (09:35 +1100)
committerNeilBrown <neil@brown.name>
Thu, 26 Nov 2015 22:35:18 +0000 (09:35 +1100)
Signed-off-by: NeilBrown <neil@brown.name>
core.h
emacs-search.c

diff --git a/core.h b/core.h
index 2027187f2430004b2cbc159820e88b8f7fb525c9..13a307cdd49aa5f838c773a32182997e42f41578 100644 (file)
--- a/core.h
+++ b/core.h
@@ -401,13 +401,13 @@ static inline char *doc_attr(struct doc *d, struct mark *m, bool forward, char *
        return ci.str2;
 }
 
-static inline int doc_set_attr(struct point *pt, char *attr, char *val)
+static inline int doc_set_attr(struct pane *p, struct point *pt,
+                              char *attr, char *val)
 {
        struct cmd_info ci = {0};
-       struct doc *d = pt->doc;
 
        ci.key = "doc:set-attr";
-       ci.focus = d->home;
+       ci.focus = p;
        ci.mark = &pt->m;
        ci.str = attr;
        ci.str2 = val;
index d38530b85a85ca8aff65fd81f40c6ec73e79deec..c4040d5b18da5c74d8739b8018bac0d8c4ce65e5 100644 (file)
@@ -103,7 +103,7 @@ DEF_CMD(search_add)
 
        do {
                /* TEMP HACK - please fix */
-               doc_set_attr(esi->end, "highlight", NULL);
+               doc_set_attr(esi->target, esi->end, "highlight", NULL);
                wch = mark_next(d, &esi->end->m);
                if (wch == WEOF)
                        return 1;
@@ -139,7 +139,7 @@ DEF_CMD(search_close)
 
        doc_del_view(ci->focus, &esi->watch);
        /* TEMP HACK - please fix */
-       doc_set_attr(esi->end, "highlight", NULL);
+       doc_set_attr(esi->target, esi->end, "highlight", NULL);
        point_free(esi->end);
        esi->end = NULL;
        mark_free(esi->start);
@@ -170,7 +170,7 @@ REDEF_CMD(search_again)
        }
 
        /* TEMP HACK - please fix */
-       doc_set_attr(esi->end, "highlight", NULL);
+       doc_set_attr(esi->target, esi->end, "highlight", NULL);
        ci2.focus = esi->target;
        m = mark_dup(esi->start, 1);
        ci2.mark = m;
@@ -186,7 +186,7 @@ REDEF_CMD(search_again)
                memset(&ci2, 0, sizeof(ci2));
                point_to_mark(esi->end, m);
                /* TEMP HACK - please fix */
-               doc_set_attr(esi->end, "highlight","fg:red,inverse");
+               doc_set_attr(esi->target, esi->end, "highlight","fg:red,inverse");
                ci2.key = "Move-View-Pos";
                ci2.focus = esi->target;
                ci2.mark = &esi->end->m;