]> git.neil.brown.name Git - edlib.git/commitdiff
Change doc:set-ref to take a pane rather than a point.
authorNeilBrown <neil@brown.name>
Wed, 25 Nov 2015 04:32:37 +0000 (15:32 +1100)
committerNeilBrown <neil@brown.name>
Wed, 25 Nov 2015 04:32:37 +0000 (15:32 +1100)
Signed-off-by: NeilBrown <neil@brown.name>
core-doc.c
core-mark.c
doc-dir.c
doc-text.c

index 6e795094584a1c633df0ba5e26351f5641007d88..5e0ebb8fe0cd82ceec816557f1adcce56aa004b2 100644 (file)
@@ -318,14 +318,14 @@ DEF_CMD(docs_step)
 
 DEF_CMD(docs_set_ref)
 {
-       struct doc *doc = (*ci->pointp)->doc;
+       struct editor *ed = pane2ed(ci->home);
        struct mark *m = ci->mark;
 
        if (ci->numeric == 1)
-               m->ref.p = list_first_entry(&doc->ed->root.focus->children,
+               m->ref.p = list_first_entry(&ed->root.focus->children,
                                            struct pane, siblings);
        else
-               m->ref.p = list_last_entry(&doc->ed->root.focus->children,
+               m->ref.p = list_last_entry(&ed->root.focus->children,
                                           struct pane, siblings);
 
        m->ref.ignore = 0;
index 4539d4450a00f9e5ba6e215c1cb9782a0a7d4f2b..9a0f9b3f0a672bfd95c745ccbef4c1bdab2c2c50 100644 (file)
@@ -245,7 +245,7 @@ struct mark *mark_dup(struct mark *m, int notype)
 
 void __mark_reset(struct doc *d, struct mark *m, int new)
 {
-       struct point *p, pt;
+       struct point *p;
        int i;
        struct cmd_info ci = {0};
 
@@ -258,10 +258,8 @@ void __mark_reset(struct doc *d, struct mark *m, int new)
        ci.key = "doc:set-ref";
        ci.mark = m;
        ci.numeric = 1; /* start */
-       pt.doc = d;
-       p = &pt;
-       ci.pointp = &p;
-       key_lookup(d->map, &ci);
+       ci.focus = d->home;
+       key_handle_focus(&ci);
 
        if (m->viewnum == MARK_UNGROUPED)
                return;
index c5efbed3dd41490154158e2709323c7fea0cff54..421c16fc3b5d3b14da1f547464d0babd9025ca4a 100644 (file)
--- a/doc-dir.c
+++ b/doc-dir.c
@@ -305,7 +305,7 @@ DEF_CMD(dir_step)
 
 DEF_CMD(dir_set_ref)
 {
-       struct doc *d = (*ci->pointp)->doc;
+       struct doc *d = ci->home->data;
        struct directory *dr = container_of(d, struct directory, doc);
        struct mark *m = ci->mark;
 
index 6a59c8df36962827a18a21b52775900d8ae0cfb0..2a2efd76fbd63a854236ec7767f07f5f00c65d7d 100644 (file)
@@ -1144,7 +1144,7 @@ DEF_CMD(text_get_str)
 
 DEF_CMD(text_set_ref)
 {
-       struct doc *d = (*ci->pointp)->doc;
+       struct doc *d = ci->home->data;
        struct mark *m = ci->mark;
        struct text *t = container_of(d, struct text, doc);