From b348db2e3dc4ecb9f584e88f902dbb40642e0231 Mon Sep 17 00:00:00 2001 From: nick black Date: Fri, 17 Dec 2021 00:00:31 -0500 Subject: [PATCH] [tfman] move structure browser along with page browser --- src/man/structure.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/man/structure.c b/src/man/structure.c index eac2192c1..d4c061272 100644 --- a/src/man/structure.c +++ b/src/man/structure.c @@ -164,28 +164,20 @@ int docstructure_next(docstructure* ds){ } int docstructure_move(docstructure* ds, int newy, unsigned movedown){ - docnode* pdn = NULL; - docnode* dn; ds->movedown = movedown; - /* FIXME - if(newy > ds->cury){ - while((dn = nctree_prev(ds->nct)) != pdn){ - if(dn->y > newy){ - dn = nctree_next(ds->nct); - break; + if(movedown){ + if(ds->curnode + 1 < ds->count){ + if(newy < ds->nodes[ds->curnode + 1]->y){ + docstructure_next(ds); } - pdn = dn; } - }else if(newy < ds->cury){ - while((dn = nctree_next(ds->nct)) != pdn){ - if(dn->y < newy){ - dn = nctree_prev(ds->nct); - break; + }else{ + if(ds->curnode){ + if(newy > ds->nodes[ds->curnode - 1]->y){ + docstructure_prev(ds); } - pdn = dn; } } - */ ds->cury = newy; if(docbar_redraw(ds)){ return -1;