[tfman] structure browser support multiple moves #2457

This commit is contained in:
nick black 2021-12-15 02:20:31 -05:00
parent bcf713b5bc
commit 73aea84a75
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -107,7 +107,6 @@ docnode_create(const char* title, int line, docstruct_e level, int y){
}
dn->level = level;
dn->line = line;
fprintf(stderr, "CREATE AT %d\n", y);
dn->y = -y;
return dn;
}
@ -154,21 +153,21 @@ int docstructure_move(docstructure* ds, int newy){
docnode* pdn = NULL;
docnode* dn;
if(newy > ds->cury){
dn = nctree_prev(ds->nct);
if(dn->y > newy){
dn = nctree_next(ds->nct);
}
/*while((dn = nctree_prev(ds->nct)) != pdn){
while((dn = nctree_prev(ds->nct)) != pdn){
if(dn->y > newy){
dn = nctree_next(ds->nct);
break;
}
pdn = dn;
}*/
}
}else if(newy < ds->cury){
dn = nctree_next(ds->nct);
if(dn->y < newy){
dn = nctree_prev(ds->nct);
}
/*while((dn = nctree_next(ds->nct)) != pdn){
while((dn = nctree_next(ds->nct)) != pdn){
if(dn->y < newy){
dn = nctree_prev(ds->nct);
break;
}
pdn = dn;
}*/
}
}
ds->cury = newy;
if(nctree_redraw(ds->nct)){