Exemplo n.º 1
0
Arquivo: zle_vi.c Projeto: Osse/zsh
int
vibackwarddeletechar(char **args)
{
    int n = zmult;

    if (invicmdmode())
	startvichange(-1);
    /* handle negative argument */
    if (n < 0) {
	int ret;
	zmult = -n;
	ret = videletechar(args);
	zmult = n;
	return ret;
    }
    /* It is an error to be at the beginning of the line, or (in *
     * insert mode) to delete past the beginning of insertion.   */
    if ((!invicmdmode() && zlecs - n < viinsbegin) || zlecs == findbol()) {
	return 1;
    }
    /* Put argument into the acceptable range -- it is not an error to  *
     * specify a greater count than the number of available characters. */
    /* HERE: we should do the test properly with DECPOS(). */
    if (n > zlecs - findbol()) {
	n = zlecs - findbol();
	/* do the deletion */
	backkill(n, CUT_FRONT|CUT_RAW);
    } else
	backkill(n, CUT_FRONT);
    return 0;
}
Exemplo n.º 2
0
void vibackwarddeletechar() /**/
{
	if (mult < 0) { mult = -mult; videletechar(); return; }
	if (mult > cs)
		mult = cs;
	if (cs-mult < viinsbegin) { feep(); return; }
	backkill(mult,1);
}
Exemplo n.º 3
0
void
vibackwarddeletechar(void)
{
    if (bindtab == altbindtab)
	startvichange(-1);
    /* handle negative argument */
    if (zmult < 0) {
	zmult = -zmult;
	videletechar();
	return;
    }
    /* It is an error to be at the beginning of the line, or (in *
     * insert mode) to delete past the beginning of insertion.   */
    if ((bindtab != altbindtab && cs - zmult < viinsbegin) || cs == findbol()) {
	feep();
	return;
    }
    /* Put argument into the acceptable range -- it is not an error to  *
     * specify a greater count than the number of available characters. */
    if (zmult > cs - findbol())
	zmult = cs - findbol();
    /* do the deletion */
    backkill(zmult, 1);
}