diff options
author | Thomas White <taw@physics.org> | 2018-01-18 22:52:46 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2018-01-18 22:52:46 +0100 |
commit | 53830f66ca3cd8573340b4f43945aeedf60e5f5f (patch) | |
tree | ac9cf4a26b81a2af1c9a3152f4c9ed7c4c452607 /src/sc_interp.c | |
parent | e5caed8842c52b6cb1abfa4e9567174d8a920e75 (diff) |
Store macro contents block in text run
We need it in order to find where to delete from, e.g. when paragraphs
get united inside a slide title
Diffstat (limited to 'src/sc_interp.c')
-rw-r--r-- | src/sc_interp.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/sc_interp.c b/src/sc_interp.c index 31c1f77..3ea8d96 100644 --- a/src/sc_interp.c +++ b/src/sc_interp.c @@ -75,8 +75,8 @@ struct sc_state int max_templates; struct template *templates; - SCBlock *macro_contents; - SCBlock *macro_real_block; + SCBlock *macro_contents; /* If running a macro, the child block of the caller */ + SCBlock *macro_real_block; /* If running a macro, the block which called the macro */ }; @@ -965,7 +965,8 @@ static int add_text(struct frame *fr, PangoContext *pc, SCBlock *bl, size_t len = strlen(text+start); Paragraph *para = last_open_para(fr); - add_run(para, bl, mrb, start, len, fontdesc, col); + add_run(para, bl, mrb, st->macro_contents, start, len, + fontdesc, col); set_para_spacing(para, st->paraspace); start += len; @@ -1027,8 +1028,10 @@ static int check_outputs(SCBlock *bl, SCInterpreter *scin) } else if ( strcmp(name, "newpara")==0 ) { struct frame *fr = sc_interp_get_frame(scin); Paragraph *para = last_open_para(fr); + struct sc_state *st = &scin->state[scin->j]; /* Add a dummy run which we can type into */ - add_run(para, bl, NULL, 0, 0, sc_interp_get_fontdesc(scin), fr->col); + add_run(para, bl, st->macro_real_block, st->macro_contents, 0, 0, + sc_interp_get_fontdesc(scin), fr->col); set_newline_at_end(para, bl); close_last_paragraph(fr); |