rem: abs(tPtr->selection.count));
add: count2);
context: paintTextField(TextField *tPtr){    W_Screen *screen = tPtr->view->screen;    W_View *view = tPtr->view;    W_View viewbuffer;    int tx, ty, tw, th;    int rx;    int bd;    int totalWidth;    char *text;    Pixmap drawbuffer;        if (!view->flags.realized || !view->flags.mapped)	return;    if (!tPtr->flags.bordered) {	bd = 0;    } else {	bd = 2;    }    if (tPtr->flags.secure) {        text = makeHiddenString(strlen(tPtr->text));    } else {        text = tPtr->text;    }    totalWidth = tPtr->view->size.width - 2*bd;        drawbuffer = XCreatePixmap(screen->display, view->window,            view->size.width, view->size.height, screen->depth);    XFillRectangle(screen->display, drawbuffer, WMColorGC(screen->white),            0,0, view->size.width,view->size.height);    /* this is quite dirty */    viewbuffer.screen = view->screen;    viewbuffer.size = view->size;    viewbuffer.window = drawbuffer;    if (tPtr->textLen > 0) {    	tw = WMWidthOfString(tPtr->font, &(text[tPtr->viewPosition]),			     tPtr->textLen - tPtr->viewPosition);    	th = WMFontHeight(tPtr->font);	ty = tPtr->offsetWidth;	switch (tPtr->flags.alignment) {     case WALeft:	    tx = tPtr->offsetWidth + 1;	    if (tw < tPtr->usableWidth)        XFillRectangle(screen->display, drawbuffer,                WMColorGC(screen->white),                bd+tw,bd, totalWidth-tw,view->size.height-2*bd);	    break;		 case WACenter:	    	    tx = tPtr->offsetWidth + (tPtr->usableWidth - tw) / 2;	    if (tw < tPtr->usableWidth)		XClearArea(screen->display, view->window, bd, bd,			   totalWidth, view->size.height-2*bd, False);	    break;	 default:	 case WARight:	    tx = tPtr->offsetWidth + tPtr->usableWidth - tw - 1;	    if (tw < tPtr->usableWidth)		XClearArea(screen->display, view->window, bd, bd,			   totalWidth-tw, view->size.height-2*bd, False);	    break;	}        if (!tPtr->flags.enabled)            WMSetColorInGC(screen->darkGray, screen->textFieldGC);        WMDrawImageString(screen, drawbuffer, screen->textFieldGC,                          tPtr->font, tx, ty,                          &(text[tPtr->viewPosition]),                          tPtr->textLen - tPtr->viewPosition);        if (tPtr->selection.count) {            int count,count2;            count = tPtr->selection.count < 0                ? tPtr->selection.position + tPtr->selection.count                : tPtr->selection.position;            count2 = abs(tPtr->selection.count);            if (count < tPtr->viewPosition) {                count2 = abs(count2 - abs(tPtr->viewPosition - count));                count = tPtr->viewPosition;            }            rx = tPtr->offsetWidth + 1 + WMWidthOfString(tPtr->font,text,count)                - WMWidthOfString(tPtr->font,text,tPtr->viewPosition);            XSetBackground(screen->display, screen->textFieldGC,                    screen->gray->color.pixel);            WMDrawImageString(screen, drawbuffer, screen->textFieldGC,                    tPtr->font, rx, ty, &(text[count]),                    abs(tPtr->selection.count));            XSetBackground(screen->display, screen->textFieldGC,                    screen->white->color.pixel);        }        if (!tPtr->flags.enabled)            WMSetColorInGC(screen->black, screen->textFieldGC);    } else {            XFillRectangle(screen->display, drawbuffer,            WMColorGC(screen->white),            bd,bd, totalWidth,view->size.height-2*bd);    }    /* draw relief */    if (tPtr->flags.bordered) {        drawRelief(&viewbuffer, tPtr->flags.beveled);    }    if (tPtr->flags.secure)        free(text);    XCopyArea(screen->display, drawbuffer, view->window,            screen->copyGC, 0,0, view->size.width,            view->size.height,0,0);    XFreePixmap(screen->display, drawbuffer);    /* draw cursor */    if (tPtr->flags.focused && tPtr->flags.enabled && tPtr->flags.cursorOn) {        paintCursor(tPtr);    }}