From: NeilBrown Date: Wed, 25 Nov 2015 04:55:39 +0000 (+1100) Subject: Change doc:get-attr to use a pane rather than a point. X-Git-Tag: lca2016~242 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=e0f725b66bb50d2fbdd73d379e5159af64a0a433;p=edlib.git Change doc:get-attr to use a pane rather than a point. Signed-off-by: NeilBrown --- diff --git a/core-doc.c b/core-doc.c index e8463b75..e673acd1 100644 --- a/core-doc.c +++ b/core-doc.c @@ -374,7 +374,7 @@ static char *__docs_get_attr(struct doc *doc, struct mark *m, DEF_CMD(docs_get_attr) { - struct doc *doc = (*ci->pointp)->doc; + struct doc *doc = ci->home->data; struct mark *m = ci->mark; bool forward = ci->numeric != 0; char *attr = ci->str; diff --git a/core.h b/core.h index 87e29053..61cd672c 100644 --- a/core.h +++ b/core.h @@ -387,15 +387,13 @@ static inline char *doc_getstr(struct pane *from, struct mark *to) static inline char *doc_attr(struct doc *d, struct mark *m, bool forward, char *attr) { struct cmd_info ci = {0}; - struct point pt, *p = &pt; - pt.doc = d; ci.key = "doc:get-attr"; - ci.pointp = &p; + ci.focus = d->home; ci.mark = m; ci.numeric = forward ? 1 : 0; ci.str = attr; - if (key_lookup(d->map, &ci) == 0) + if (key_handle_focus(&ci) == 0) return NULL; return ci.str2; } diff --git a/doc-dir.c b/doc-dir.c index 081156cd..9e1f3b40 100644 --- a/doc-dir.c +++ b/doc-dir.c @@ -472,7 +472,7 @@ static char *__dir_get_attr(struct doc *d, struct mark *m, DEF_CMD(dir_get_attr) { - struct doc *d = (*ci->pointp)->doc; + struct doc *d = ci->home->data; struct mark *m = ci->mark; bool forward = ci->numeric != 0; char *attr = ci->str; diff --git a/doc-text.c b/doc-text.c index ec5f9851..d4461c93 100644 --- a/doc-text.c +++ b/doc-text.c @@ -1466,7 +1466,7 @@ static char *__text_get_attr(struct doc *d, struct mark *m, DEF_CMD(text_get_attr) { - struct doc *d = (*ci->pointp)->doc; + struct doc *d = ci->home->data; struct mark *m = ci->mark; bool forward = ci->numeric != 0; char *attr = ci->str;