add: if (index < lPtr->fullFitLines+lPtr->flags.dontFitAll-lPtr->topItem) { paintList(lPtr); }
context: WMAddSortedListItem(WMList *lPtr, char *text){    WMListItem *item;    WMListItem *tmp;    int index;    item = wmalloc(sizeof(WMListItem));    memset(item, 0, sizeof(WMListItem));    item->text = wstrdup(text);    if (!lPtr->items) {	lPtr->items = item;	index = 0;    } else if (strcmp(lPtr->items->text, text) > 0) {	item->nextPtr = lPtr->items;	lPtr->items = item;	index = 1;    } else {		int added = 0;		index = 0;	tmp = lPtr->items;	while (tmp->nextPtr) {	    if (strcmp(tmp->nextPtr->text, text) >= 0) {		item->nextPtr = tmp->nextPtr;		tmp->nextPtr = item;		added = 1;		break;	    }	    index++;	    tmp = tmp->nextPtr;	}	if (!added) {	    tmp->nextPtr = item;	}    }        lPtr->itemCount++;        if (lPtr->selectedItem >= index)	lPtr->selectedItem++;    /* update the scroller when idle, so that we don't waste time     * updating it when another item is going to be added later */    if (!lPtr->idleID) {	lPtr->idleID = WMAddIdleHandler((WMCallback*)updateScroller, lPtr);    }     return item;}