From: NeilBrown Date: Wed, 25 Nov 2015 22:10:16 +0000 (+1100) Subject: Use Move-File to move to start of a newly created document. X-Git-Tag: lca2016~229 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=90aaa64e3978fc14b5fd3cb69be5ce0a2537dac8;p=edlib.git Use Move-File to move to start of a newly created document. This is cleaner than moving the point directly Signed-off-by: NeilBrown --- diff --git a/core-doc.c b/core-doc.c index 89a7c4bf..f1bdac33 100644 --- a/core-doc.c +++ b/core-doc.c @@ -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; }