From fe20c9869fc4aea699eb7ff2b045e283b6ebffa1 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 8 Sep 2023 17:37:28 +1000 Subject: [PATCH] markup: switch to embedded-data pattern Signed-off-by: NeilBrown --- lib-markup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib-markup.c b/lib-markup.c index 574b4ceb..0c8f51b3 100644 --- a/lib-markup.c +++ b/lib-markup.c @@ -16,13 +16,14 @@ #include #include - +#define PANE_DATA_TYPE struct mu_info #include "core.h" #include "misc.h" struct mu_info { int view; }; +#include "core-pane.h" static struct map *mu_map safe; @@ -466,10 +467,10 @@ static struct pane *do_markup_attach(struct pane *p safe) struct pane *ret; struct mu_info *mu; - alloc(mu, pane); - ret = pane_register(p, 0, &markup_handle.c, mu); + ret = pane_register(p, 0, &markup_handle.c); if (!ret) return NULL; + mu = ret->data; mu->view = home_call(p, "doc:add-view", ret) - 1; return ret; @@ -509,7 +510,6 @@ void edlib_init(struct pane *ed safe) key_add(mu_map, "doc:render-line", &render_line); key_add(mu_map, "doc:render-line-prev", &render_prev); key_add(mu_map, "Clone", &mu_clone); - key_add(mu_map, "Free", &edlib_do_free); key_add(mu_map, "Notify:clip", &mu_clip); call_comm("global-set-command", ed, &markup_attach,