]> git.neil.brown.name Git - edlib.git/commitdiff
Use Move-File to move to start of a newly created document.
authorNeilBrown <neil@brown.name>
Wed, 25 Nov 2015 22:10:16 +0000 (09:10 +1100)
committerNeilBrown <neil@brown.name>
Wed, 25 Nov 2015 22:10:16 +0000 (09:10 +1100)
This is cleaner than moving the point directly

Signed-off-by: NeilBrown <neil@brown.name>
core-doc.c

index 89a7c4bfb6de92ee8f338c5fed2523a3141794f3..f1bdac33787268d06e708be1666d27f27e4ce29a 100644 (file)
@@ -258,8 +258,8 @@ struct pane *doc_from_text(struct pane *parent, char *name, char *text)
 {
        bool first = 1;
        struct pane *p;
-       struct point **ptp;
        struct doc *d;
+       struct cmd_info ci = {0};
 
        p = doc_new(pane2ed(parent), "text");
        if (!p)
@@ -272,8 +272,10 @@ struct pane *doc_from_text(struct pane *parent, char *name, char *text)
                return p;
        }
        doc_replace(p, NULL, text, &first);
-       ptp = pane_point(p);
-       point_reset(*ptp);
+       ci.key = "Move-File";
+       ci.numeric = -1;
+       ci.focus = p;
+       key_handle_focus(&ci);
        return p;
 }