rem: if(1)   { affectNextParas(tPtr, para, -23); putParagraphOnPixmap(tPtr, para, True); drawDocumentPartsOnPixmap(tPtr, False); updateScrollers(tPtr); paintText(tPtr);  } else WMRefreshText(tPtr, tPtr->vpos, tPtr->hpos);
add: doprevpara = True; if (currentp > 1) { para->chunks = NULL; WMRemoveTextParagraph(tPtr, currentp); WMSetTextCurrentParagraph(tPtr, currentp - 1); WMSetTextCurrentChunk(tPtr, -1); para = tPtr->currentPara; if (para) { if (!tPtr->currentChunk || !para->chunks) { para->chunks = chunk; tPtr->currentChunk = chunk; } else tPtr->currentChunk->next = chunk; } } } } }  if (1) {  affectNextParas(tPtr, para, -23); putParagraphOnPixmap(tPtr, para, True); drawDocumentPartsOnPixmap(tPtr, False); updateScrollers(tPtr); paintText(tPtr);  } else WMRefreshText(tPtr, tPtr->vpos, tPtr->hpos);
context: deleteTextInteractively(Text *tPtr, DeleteType type){    Paragraph *para;    Chunk *chunk;    short pos,w=0,h=0, doprev=False, doprevpara=False;    WMFont *font;    int current = WMGetTextCurrentChunk(tPtr);    if(!(para = tPtr->currentPara)) return;    if(!(chunk = tPtr->currentChunk)) return;    font = (tPtr->monoFont)?tPtr->dFont:chunk->font;    doprev = (tPtr->tpos < 2);    switch(type) {    case dtDelete: /* delete _after_ cursor ... implement later */    case dtBackSpace: /* delete _before_ cursor */        if(chunk->chars > 1) {            pos = tPtr->tpos-1;            printf("here %d\n", pos);            if(pos>0) {                w = WMWidthOfString(font, &chunk->text[pos], 1);                memmove(&(chunk->text[pos]),                        &(chunk->text[pos+1]), chunk->chars-pos+1);                tPtr->tpos--;                chunk->chars--;            } } else {            WMRemoveTextChunk(tPtr, current);            doprev = True;            }        if(doprev) {            if(current > 0) {                WMSetTextCurrentChunk(tPtr, current-1);                if(!tPtr->currentChunk) {                    printf("PREV PARA\n");                } else {                    tPtr->tpos = tPtr->currentChunk->chars;                }            } else if(0){                int currentp = WMGetTextCurrentParagraph(tPtr);                doprevpara = True;                if(currentp > 1) {                    para->chunks = NULL;                    WMRemoveTextParagraph(tPtr, currentp);                    WMSetTextCurrentParagraph(tPtr, currentp-1);                    WMSetTextCurrentChunk(tPtr, -1);                    para = tPtr->currentPara;                    if(para) {                        if(!tPtr->currentChunk || !para->chunks)  {                            para->chunks = chunk;                            tPtr->currentChunk =  chunk;                        } else                            tPtr->currentChunk->next = chunk;                    } } } } }    if(1)   { //if(1||(para && !doprevpara)) {        affectNextParas(tPtr, para, -23);        putParagraphOnPixmap(tPtr, para, True);        drawDocumentPartsOnPixmap(tPtr, False);        updateScrollers(tPtr);        paintText(tPtr);        //cursorToTextPosition(tPtr, tPtr->clicked.x-w, tPtr->clicked.y);    } else WMRefreshText(tPtr, tPtr->vpos, tPtr->hpos);}