[ncman] handle tagged paragraphs

This commit is contained in:
nick black 2021-12-08 05:19:05 -05:00
parent 21488d394d
commit e23cf59f57
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
3 changed files with 19 additions and 2 deletions

View File

@ -576,9 +576,9 @@ troff_parse(const unsigned char* map, size_t mlen, pagedom* dom){
return -1;
}
current_para->ttype = node;
}else if(node->ltype == LINE_TH){
}else if(node->ltype == LINE_TP){
if(dom->root == NULL){
fprintf(stderr, "theorem transcends structure\n");
fprintf(stderr, "tagged paragraph transcends structure\n");
return -1;
}
if((current_para = add_node(current_para, NULL)) == NULL){
@ -631,6 +631,7 @@ draw_domnode(struct ncplane* p, const pagedom* dom, const pagenode* n){
ncplane_cursor_move_yx(p, -1, 0);
break;
case LINE_PP: // paragraph
case LINE_TP: // tagged paragraph
if(n->text){
ncplane_cursor_move_rel(p, 2, 0);
size_t b = 0;

16
src/poc/cli3.c Normal file
View File

@ -0,0 +1,16 @@
#include <notcurses/notcurses.h>
int main(void){
struct notcurses_options opts = {
.flags = NCOPTION_PRESERVE_CURSOR |
NCOPTION_NO_CLEAR_BITMAPS |
NCOPTION_DRAIN_INPUT,
};
struct notcurses* nc = notcurses_init(&opts, NULL);
if(nc == NULL){
return EXIT_FAILURE;
}
notcurses_render(nc);
notcurses_stop(nc);
return EXIT_SUCCESS;
}