示例#1
0
文件: zle_word.c 项目: zsh-users/zsh
int
vibackwardblankword(char **args)
{
    int n = zmult;

    if (n < 0) {
	int ret;
	zmult = -n;
	ret = viforwardblankword(args);
	zmult = n;
	return ret;
    }
    while (n--) {
	int nl = 0;
	while (zlecs) {
	    int pos = zlecs;
	    DECPOS(pos);
	    if (!ZC_inblank(zleline[pos]))
		break;
	    nl += (zleline[pos] == ZWC('\n'));
	    if (nl == 2) break;
	    zlecs = pos;
	}
	while (zlecs) {
	    int pos = zlecs;
	    DECPOS(pos);
	    if (ZC_inblank(zleline[pos]))
		break;
	    zlecs = pos;
	}
    }
    return 0;
}
示例#2
0
文件: zle_word.c 项目: zsh-users/zsh
int
viforwardblankwordend(char **args)
{
    int n = zmult;

    if (n < 0) {
	int ret;
	zmult = -n;
	ret = vibackwardblankwordend(args);
	zmult = n;
	return ret;
    }
    while (n--) {
	while (zlecs != zlell) {
	    int pos = zlecs;
	    INCPOS(pos);
	    if (!ZC_inblank(zleline[pos]))
		break;
	    zlecs = pos;
	}
	while (zlecs != zlell) {
	    int pos = zlecs;
	    INCPOS(pos);
	    if (ZC_inblank(zleline[pos]))
		break;
	    zlecs = pos;
	}
    }
    if (zlecs != zlell && virangeflag)
	INCCS();
    return 0;
}
示例#3
0
文件: zle_word.c 项目: zsh-users/zsh
int
viforwardblankword(char **args)
{
    int n = zmult;

    if (n < 0) {
	int ret;
	zmult = -n;
	ret = vibackwardblankword(args);
	zmult = n;
	return ret;
    }
    while (n--) {
	int nl;
	while (zlecs != zlell && !ZC_inblank(zleline[zlecs]))
	    INCCS();
	if (wordflag && !n)
	    return 0;
	nl = (zleline[zlecs] == ZWC('\n'));
	while (zlecs != zlell && nl < 2 && ZC_inblank(zleline[zlecs])) {
	    INCCS();
	    nl += (zleline[zlecs] == ZWC('\n'));
	}
    }
    return 0;
}
示例#4
0
文件: zle_word.c 项目: AMDmi3/zsh
int
vibackwardword(char **args)
{
    int n = zmult;

    if (n < 0) {
	int ret;
	zmult = -n;
	ret = backwardword(args);
	zmult = n;
	return ret;
    }
    while (n--) {
	int nl = 0;
	while (zlecs) {
	    DECCS();
	    if (!ZC_inblank(zleline[zlecs]))
		break;
	    nl += (zleline[zlecs] == ZWC('\n'));
	    if (nl == 2) {
		INCCS();
		break;
	    }
	}
	if (zlecs) {
	    int pos = zlecs;
	    if (Z_vialnum(zleline[pos])) {
		for (;;) {
		    zlecs = pos;
		    if (zlecs == 0)
			break;
		    DECPOS(pos);
		    if (!Z_vialnum(zleline[pos]))
			break;
		}
	    } else {
		for (;;) {
		    zlecs = pos;
		    if (zlecs == 0)
			break;
		    DECPOS(pos);
		    if (Z_vialnum(zleline[pos]) || ZC_inblank(zleline[pos]))
			break;
		}
	    }
	}
    }
    return 0;
}
示例#5
0
文件: zle_word.c 项目: AMDmi3/zsh
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;
}
示例#6
0
文件: zle_word.c 项目: AMDmi3/zsh
int
vibackwardwordend(char **args)
{
    int n = zmult;

    if (n < 0) {
	int ret;
	zmult = -n;
	ret = viforwardwordend(args);
	zmult = n;
	return ret;
    }
    while (n-- && zlecs > 1) {
	int start = 0;
	if (Z_vialnum(zleline[zlecs]))
	    start = 1;
	else if (!ZC_inblank(zleline[zlecs]))
	    start = 2;
	DECCS();
	while (zlecs) {
	    int same = (start != 1) && ZC_iblank(zleline[zlecs]);
	    if (start)
		same |= Z_vialnum(zleline[zlecs]);
	    if (same == (start == 2))
		break;
	    DECCS();
	}
	while (zlecs && ZC_iblank(zleline[zlecs]))
	    DECCS();
    }
    return 0;
}
示例#7
0
文件: zle_word.c 项目: zsh-users/zsh
int
vibackwardblankwordend(char **args)
{
    int n = zmult;

    if (n < 0) {
	int ret;
	zmult = -n;
	ret = viforwardblankwordend(args);
	zmult = n;
	return ret;
    }
    while (n--) {
	while (zlecs && !ZC_inblank(zleline[zlecs]))
	    DECCS();
	while (zlecs && ZC_inblank(zleline[zlecs]))
	    DECCS();
    }
    return 0;
}
示例#8
0
文件: zle_word.c 项目: zsh-users/zsh
int
vibackwardword(char **args)
{
    int n = zmult;

    if (n < 0) {
	int ret;
	zmult = -n;
	ret = viforwardword(args);
	zmult = n;
	return ret;
    }
    while (n--) {
	int nl = 0;
	while (zlecs) {
	    DECCS();
	    if (!ZC_inblank(zleline[zlecs]))
		break;
	    nl += (zleline[zlecs] == ZWC('\n'));
	    if (nl == 2) {
		INCCS();
		break;
	    }
	}
	if (zlecs) {
	    int pos = zlecs;
	    int cc = wordclass(zleline[pos]);
	    for (;;) {
		zlecs = pos;
		if (zlecs == 0)
		    break;
		DECPOS(pos);
		if (wordclass(zleline[pos]) != cc || ZC_inblank(zleline[pos]))
		    break;
	    }
	}
    }
    return 0;
}
示例#9
0
文件: zle_word.c 项目: zsh-users/zsh
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;
}