2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
5 * %sccs.include.redist.c%
9 static char sccsid
[] = "$Id: v_left.c,v 8.2 1993/08/19 16:10:45 bostic Exp $ (Berkeley) $Date: 1993/08/19 16:10:45 $";
12 #include <sys/types.h>
18 * v_left -- [count]^H, [count]h
19 * Move left by columns.
22 v_left(sp
, ep
, vp
, fm
, tm
, rp
)
30 cnt
= F_ISSET(vp
, VC_C1SET
) ? vp
->count
: 1;
33 msgq(sp
, M_BERR
, "Already in the first column.");
39 rp
->cno
= fm
->cno
- cnt
;
46 * v_cfirst -- [count]_
48 * Move to the first non-blank column on a line.
51 v_cfirst(sp
, ep
, vp
, fm
, tm
, rp
)
59 /* A count moves down count - 1 rows, so, "3_" is the same as "2j_". */
60 cnt
= F_ISSET(vp
, VC_C1SET
) ? vp
->count
: 1;
63 if (v_down(sp
, ep
, vp
, fm
, tm
, rp
))
72 * Move to the first non-blank column on this line.
75 v_first(sp
, ep
, vp
, fm
, tm
, rp
)
82 * Yielding to none in our quest for compatibility with every
83 * historical blemish of vi, no matter how strange it might be,
84 * we permit the user to enter a count and then ignore it.
92 * Move to column count or the first column on this line. If the
93 * requested column is past EOL, move to EOL. The nasty part is
94 * that we have to know character column widths to make this work.
97 v_ncol(sp
, ep
, vp
, fm
, tm
, rp
)
103 if (F_ISSET(vp
, VC_C1SET
) && vp
->count
> 1)
105 sp
->s_chposition(sp
, ep
, fm
->lno
, (size_t)--vp
->count
);
114 * Move to the first column on this line.
117 v_zero(sp
, ep
, vp
, fm
, tm
, rp
)