ncselector_additem: extend longops/longdesc if necessary #846

pull/848/head
nick black 4 years ago
parent 2fabe85e6a
commit 7e43077128
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -281,6 +281,16 @@ int ncselector_additem(ncselector* n, const struct ncselector_item* item){
n->items = items;
n->items[n->itemcount].option = strdup(item->option);
n->items[n->itemcount].desc = strdup(item->desc);
int cols = mbswidth(item->option);
n->items[n->itemcount].opcolumns = cols;
if(cols > n->longop){
n->longop = cols;
}
cols = mbswidth(item->desc);
n->items[n->itemcount].desccolumns = cols;
if(cols > n->longdesc){
n->longdesc = cols;
}
++n->itemcount;
return ncselector_draw(n);
}

Loading…
Cancel
Save