]> git.neil.brown.name Git - edlib.git/commitdiff
doc_attr: pass pane instead of doc
authorNeilBrown <neil@brown.name>
Thu, 26 Nov 2015 23:52:32 +0000 (10:52 +1100)
committerNeilBrown <neil@brown.name>
Thu, 26 Nov 2015 23:55:38 +0000 (10:55 +1100)
Signed-off-by: NeilBrown <neil@brown.name>
core-doc.c
core-pane.c
core.h
render-format.c

index a6ef54941823ddfd6be21db55a09db8d7c0bbf30..2c2b59b5fb2968e060b77123ee5fa118fc723dd3 100644 (file)
@@ -680,7 +680,7 @@ static char *__docs_get_attr(struct doc *doc, struct mark *m,
        d = p->data;
        if (strcmp(attr, "name") == 0)
                return d->name;
-       return doc_attr(d, NULL, 0, attr);
+       return doc_attr(p, NULL, 0, attr);
 }
 
 DEF_CMD(docs_get_attr)
index 4ec81d35a6fda1d1848d5b4ea1fe9b541c406b44..c18f1776e07c2b6af34b29dd019350275531dc21 100644 (file)
@@ -507,7 +507,7 @@ char *pane_attr_get(struct pane *p, char *key)
                if (a)
                        return a;
                if (p->point) {
-                       a = doc_attr(p->point->doc, NULL, 0, key);
+                       a = doc_attr(p, NULL, 0, key);
                        if (a)
                                return a;
                }
diff --git a/core.h b/core.h
index bbb9ac9eabc16490c95e998afda56bdc8a7916ca..b1e79f544bc95e9e810658000c66a68007c64407 100644 (file)
--- a/core.h
+++ b/core.h
@@ -388,12 +388,12 @@ static inline char *doc_getstr(struct pane *from, struct mark *to)
        return ci.str;
 }
 
-static inline char *doc_attr(struct doc *d, struct mark *m, bool forward, char *attr)
+static inline char *doc_attr(struct pane *dp, struct mark *m, bool forward, char *attr)
 {
        struct cmd_info ci = {0};
 
        ci.key = "doc:get-attr";
-       ci.focus = d->home;
+       ci.focus = dp;
        ci.mark = m;
        ci.numeric = forward ? 1 : 0;
        ci.str = attr;
index 9f8f7e66c2a9734667ddefac855865b8ccd344a0..df63b8904b7fe1410d3fae99495950bfa449fd1f 100644 (file)
@@ -97,7 +97,7 @@ DEF_CMD(render_line)
                        buf_append(&ret, ch);
                        continue;
                }
-               val = doc_attr(d, m, 1, buf);
+               val = doc_attr(dp, m, 1, buf);
                if (!val)
                        val = "-";
                if (*n != ':') {