Exemplo n.º 1
0
int
viforwardwordend(char **args)
{
    int n = zmult;

    if (n < 0) {
	int ret;
	zmult = -n;
	ret = vibackwardwordend(args);
	zmult = n;
	return ret;
    }
    while (n--) {
	int pos;
	while (zlecs != zlell) {
	    pos = zlecs;
	    INCPOS(pos);
	    if (!ZC_inblank(zleline[pos]))
		break;
	    zlecs = pos;
	}
	if (zlecs != zlell) {
	    pos = zlecs;
	    INCPOS(pos);
	    if (Z_vialnum(zleline[pos])) {
		for (;;) {
		    zlecs = pos;
		    if (zlecs == zlell)
			break;
		    INCPOS(pos);
		    if (!Z_vialnum(zleline[pos]))
			break;
		}
	    } else {
		for (;;) {
		    zlecs = pos;
		    if (zlecs == zlell)
			break;
		    INCPOS(pos);
		    if (Z_vialnum(zleline[pos]) || ZC_inblank(zleline[pos]))
			break;
		}
	    }
	}
    }
    if (zlecs != zlell && virangeflag)
	INCCS();
    return 0;
}
Exemplo n.º 2
0
int
viforwardwordend(char **args)
{
    int n = zmult;

    if (n < 0) {
	int ret;
	zmult = -n;
	ret = vibackwardwordend(args);
	zmult = n;
	return ret;
    }
    while (n--) {
	int pos;
	while (zlecs != zlell) {
	    pos = zlecs;
	    INCPOS(pos);
	    if (!ZC_inblank(zleline[pos]))
		break;
	    zlecs = pos;
	}
	if (zlecs != zlell) {
	    int cc;
	    pos = zlecs;
	    INCPOS(pos);
	    cc = wordclass(zleline[pos]);
	    for (;;) {
		zlecs = pos;
		if (zlecs == zlell)
		    break;
		INCPOS(pos);
		if (wordclass(zleline[pos]) != cc)
			break;
	    }
	}
    }
    if (zlecs != zlell && virangeflag)
	INCCS();
    return 0;
}