diff --git a/src/man/structure.c b/src/man/structure.c index 72f9e2e3d..5dc0b42f0 100644 --- a/src/man/structure.c +++ b/src/man/structure.c @@ -154,21 +154,21 @@ int docstructure_move(docstructure* ds, int newy){ docnode* pdn = NULL; docnode* dn; if(newy > ds->cury){ - while((dn = nctree_prev(ds->nct)) != pdn){ - if(dn->y > newy){ - dn = nctree_next(ds->nct); - break; - } - pdn = dn; + dn = nctree_prev(ds->nct); + if(dn->y > newy){ + dn = nctree_next(ds->nct); } + /*while((dn = nctree_prev(ds->nct)) != pdn){ + pdn = dn; + }*/ }else if(newy < ds->cury){ - while((dn = nctree_next(ds->nct)) != pdn){ - if(dn->y > newy){ - dn = nctree_prev(ds->nct); - break; - } - pdn = dn; + dn = nctree_next(ds->nct); + if(dn->y < newy){ + dn = nctree_prev(ds->nct); } + /*while((dn = nctree_next(ds->nct)) != pdn){ + pdn = dn; + }*/ } ds->cury = newy; if(nctree_redraw(ds->nct)){