if (blinker) cursor = ATTR_ACTCURS; else         cursor = 0;
if (blinker || !cfg.blink_cur) cursor = ATTR_ACTCURS; else cursor = 0;
static void do_paint (Context ctx, int may_optimise){     int i, j, start, our_curs_y;    unsigned long attr, rv, cursor;    char ch[1024];    if (cursor_on) {        if (has_focus) {	    if (blinker) cursor = ATTR_ACTCURS;	    else         cursor = 0;        }        else            cursor = ATTR_PASCURS;    }    else           cursor = 0;    rv = (rvideo ? ATTR_REVERSE : 0);    our_curs_y = curs_y + (scrtop - disptop) / (cols+1);    for (i=0; i<rows; i++) {	int idx = i*(cols+1);	for (j=0; j<=cols; j++,idx++) {	    unsigned long *d = disptop+idx;	    wanttext[idx] = ((*d ^ rv			      ^ (selstart <= d && d < selend ?				 ATTR_REVERSE : 0)) |			     (i==our_curs_y && j==curs_x ? cursor : 0));	}    }    /*     * We would perform scrolling optimisations in here, if they     * didn't have a nasty tendency to cause the whole sodding     * program to hang for a second at speed-critical moments.     * We'll leave it well alone...     */    for (i=0; i<rows; i++) {	int idx = i*(cols+1);	start = -1;	for (j=0; j<=cols; j++,idx++) {	    unsigned long t = wanttext[idx];	    int needs_update = (j < cols && t != disptext[idx]);	    int keep_going = (start != -1 && needs_update &&			      (t & ATTR_MASK) == attr &&			      j-start < sizeof(ch));	    if (start != -1 && !keep_going) {		do_text (ctx, start, i, ch, j-start, attr);		start = -1;	    }	    if (needs_update) {		if (start == -1) {		    start = j;		    attr = t & ATTR_MASK;		}		ch[j-start] = (char) (t & CHAR_MASK);	    }	    disptext[idx] = t;	}    }}