Exemplo n.º 1
0
/* ARGSUSED */
int
killregion(int f, int n)
{
	int	s;
	struct region	region;

	if ((s = getregion(&region)) != TRUE)
		return (s);
	/* This is a kill-type command, so do magic kill buffer stuff. */
	if ((lastflag & CFKILL) == 0)
		kdelete();
	thisflag |= CFKILL;
	curwp->w_dotp = region.r_linep;
	curwp->w_doto = region.r_offset;
	s = ldelete(region.r_size, KFORW);
	clearmark(FFARG, 0);

	return (s);
}
Exemplo n.º 2
0
/* ARGSUSED */
int
copyregion(int f, int n)
{
	struct line	*linep;
	struct region	 region;
	int	 loffs;
	int	 s;

	if ((s = getregion(&region)) != TRUE)
		return (s);

	/* kill type command */
	if ((lastflag & CFKILL) == 0)
		kdelete();
	thisflag |= CFKILL;

	/* current line */
	linep = region.r_linep;

	/* current offset */
	loffs = region.r_offset;

	while (region.r_size--) {
		if (loffs == llength(linep)) {	/* End of line.		 */
			if ((s = kinsert('\n', KFORW)) != TRUE)
				return (s);
			linep = lforw(linep);
			loffs = 0;
		} else {			/* Middle of line.	 */
			if ((s = kinsert(lgetc(linep, loffs), KFORW)) != TRUE)
				return (s);
			++loffs;
		}
	}
	clearmark(FFARG, 0);

	return (TRUE);
}
Exemplo n.º 3
0
/* ARGSUSED */
int
markpara(int f, int n)
{
    int i = 0;

    if (n == 0)
        return (TRUE);

    clearmark(FFARG, 0);

    if (findpara() == FALSE)
        return (TRUE);

    (void)do_gotoeop(FFRAND, n, &i);

    /* set the mark here */
    curwp->w_markp = curwp->w_dotp;
    curwp->w_marko = curwp->w_doto;

    (void)gotobop(FFRAND, i);

    return (TRUE);
}