Lines Matching +full:left +full:- +full:shifted

1 /*-
24 enum which {RETAB, LEFT, RIGHT}; enumerator
28 * ex_shiftl -- :<[<...]
36 return (shift(sp, cmdp, LEFT)); in ex_shiftl()
40 * ex_shiftr -- :>[>...]
51 * ex_retab -- Expand tabs (if enabled)
63 * shift --
82 /* Copy the lines being shifted into the unnamed buffer. */ in shift()
83 if (cut(sp, NULL, &cmdp->addr1, &cmdp->addr2, CUT_LINEMODE)) in shift()
90 * cmdp->argv[0] points to the string of '>' or '<' characters. in shift()
96 for (p = cmdp->argv[0]->bp, sw = 0; *p == '>' || *p == '<'; ++p) in shift()
102 for (from = cmdp->addr1.lno, to = cmdp->addr2.lno; from <= to; ++from) { in shift()
106 if (sp->lno == from) in shift()
119 oldcol += O_VAL(sp, O_TABSTOP) - in shift()
130 newcol = oldcol < sw ? 0 : oldcol - sw; in shift()
132 if (sp->lno == from) in shift()
150 newcol -= O_VAL(sp, O_TABSTOP); in shift()
153 for (; newcol > 0; --newcol, ++newidx) in shift()
157 MEMCPY(tbp, p + oldidx, len - oldidx); in shift()
160 if (db_set(sp, from, bp, (tbp + (len - oldidx)) - bp)) { in shift()
169 * cursor was repositioned to the first non-blank character in shift()
170 * of the lowest numbered line shifted. If called from ex, in shift()
171 * the cursor was repositioned to the first non-blank of the in shift()
172 * highest numbered line shifted. Here, if the cursor isn't in shift()
174 * first non-blank of the last line shifted. (This makes in shift()
176 * the shifted lines, it doesn't get moved at all. This in shift()
181 if (sp->lno == from) { in shift()
184 sp->cno += newidx - oldidx; in shift()
185 else if (sp->cno >= oldidx - newidx) in shift()
186 sp->cno -= oldidx - newidx; in shift()
190 sp->lno = to; in shift()
191 sp->cno = 0; in shift()
192 (void)nonblank(sp, to, &sp->cno); in shift()
197 sp->rptlines[L_SHIFT] += cmdp->addr2.lno - cmdp->addr1.lno + 1; in shift()