Lines Matching full:vp
65 v_iA(SCR *sp, VICMD *vp) in v_iA() argument
69 if (!db_get(sp, vp->m_start.lno, 0, NULL, &len)) in v_iA()
74 return (v_ia(sp, vp)); in v_iA()
85 v_ia(SCR *sp, VICMD *vp) in v_ia() argument
92 flags = set_txt_std(sp, vp, 0); in v_ia()
94 sp->lno = vp->m_start.lno; in v_ia()
111 return (v_txt(sp, vp, NULL, p, len, in v_ia()
112 0, OOBLNO, F_ISSET(vp, VC_C1SET) ? vp->count : 1, flags)); in v_ia()
122 v_iI(SCR *sp, VICMD *vp) in v_iI() argument
125 if (nonblank(sp, vp->m_start.lno, &sp->cno)) in v_iI()
130 return (v_ii(sp, vp)); in v_iI()
141 v_ii(SCR *sp, VICMD *vp) in v_ii() argument
148 flags = set_txt_std(sp, vp, 0); in v_ii()
150 sp->lno = vp->m_start.lno; in v_ii()
160 return (v_txt(sp, vp, NULL, p, len, in v_ii()
161 0, OOBLNO, F_ISSET(vp, VC_C1SET) ? vp->count : 1, flags)); in v_ii()
174 v_iO(SCR *sp, VICMD *vp) in v_iO() argument
176 return (io(sp, vp, O_cmd)); in v_iO()
186 v_io(SCR *sp, VICMD *vp) in v_io() argument
188 return (io(sp, vp, o_cmd)); in v_io()
192 io(SCR *sp, VICMD *vp, enum which cmd) in io() argument
199 flags = set_txt_std(sp, vp, TXT_ADDNEWLINE | TXT_APPENDEOL); in io()
229 return (v_txt(sp, vp, NULL, p, len, in io()
230 0, ai_line, F_ISSET(vp, VC_C1SET) ? vp->count : 1, flags)); in io()
242 v_change(SCR *sp, VICMD *vp) in v_change() argument
256 F_CLR(vp, VM_RCM_MASK); in v_change()
257 F_SET(vp, VM_RCM_SET); in v_change()
263 if (vp->m_start.lno == vp->m_stop.lno && in v_change()
264 db_eget(sp, vp->m_start.lno, &p, &len, &isempty)) { in v_change()
267 return (v_ia(sp, vp)); in v_change()
270 flags = set_txt_std(sp, vp, 0); in v_change()
280 lmode = F_ISSET(vp, VM_LMODE) ? CUT_LINEMODE : 0; in v_change()
282 vp->m_start.cno = 0; in v_change()
284 if (nonblank(sp, vp->m_start.lno, &vp->m_start.cno)) in v_change()
289 sp->lno = vp->m_start.lno; in v_change()
290 sp->cno = vp->m_start.cno; in v_change()
298 if (!lmode && vp->m_start.lno == vp->m_stop.lno) { in v_change()
305 F_ISSET(vp, VC_BUFFER) ? &vp->buffer : NULL, in v_change()
306 &vp->m_start, &vp->m_stop, lmode)) in v_change()
311 return (v_txt(sp, vp, &vp->m_stop, p, len, in v_change()
312 0, OOBLNO, F_ISSET(vp, VC_C1SET) ? vp->count : 1, flags)); in v_change()
327 F_ISSET(vp, VC_BUFFER) ? &vp->buffer : NULL, in v_change()
328 &vp->m_start, &vp->m_stop, lmode)) in v_change()
332 if (lmode && vp->m_start.cno) { in v_change()
337 if (db_get(sp, vp->m_start.lno, DBG_FATAL, &p, &len)) in v_change()
339 GET_SPACE_RETW(sp, bp, blen, vp->m_start.cno); in v_change()
340 MEMMOVE(bp, p, vp->m_start.cno); in v_change()
345 if (del(sp, &vp->m_start, &vp->m_stop, lmode)) in v_change()
350 if (db_insert(sp, vp->m_start.lno, bp, vp->m_start.cno)) in v_change()
352 sp->lno = vp->m_start.lno; in v_change()
353 len = sp->cno = vp->m_start.cno; in v_change()
357 if (db_eget(sp, vp->m_start.lno, &p, &len, &isempty)) { in v_change()
364 if (vp->m_start.cno >= len) in v_change()
367 rval = v_txt(sp, vp, NULL, p, len, in v_change()
368 0, OOBLNO, F_ISSET(vp, VC_C1SET) ? vp->count : 1, flags); in v_change()
382 v_Replace(SCR *sp, VICMD *vp) in v_Replace() argument
389 flags = set_txt_std(sp, vp, 0); in v_Replace()
392 if (db_eget(sp, vp->m_start.lno, &p, &len, &isempty)) { in v_Replace()
402 vp->m_stop.lno = vp->m_start.lno; in v_Replace()
403 vp->m_stop.cno = len ? len - 1 : 0; in v_Replace()
405 return (v_txt(sp, vp, &vp->m_stop, p, len, in v_Replace()
406 0, OOBLNO, F_ISSET(vp, VC_C1SET) ? vp->count : 1, flags)); in v_Replace()
416 v_subst(SCR *sp, VICMD *vp) in v_subst() argument
423 flags = set_txt_std(sp, vp, 0); in v_subst()
426 if (db_eget(sp, vp->m_start.lno, &p, &len, &isempty)) { in v_subst()
437 vp->m_stop.lno = vp->m_start.lno; in v_subst()
438 vp->m_stop.cno = in v_subst()
439 vp->m_start.cno + (F_ISSET(vp, VC_C1SET) ? vp->count - 1 : 0); in v_subst()
440 if (vp->m_stop.cno > len - 1) in v_subst()
441 vp->m_stop.cno = len - 1; in v_subst()
444 F_ISSET(vp, VC_BUFFER) ? &vp->buffer : NULL, in v_subst()
445 &vp->m_start, &vp->m_stop, 0)) in v_subst()
448 return (v_txt(sp, vp, &vp->m_stop, p, len, 0, OOBLNO, 1, flags)); in v_subst()
456 set_txt_std(SCR *sp, VICMD *vp, u_int32_t flags) in set_txt_std() argument
461 if (F_ISSET(vp, VC_ISDOT)) in set_txt_std()
507 (!MAPPED_KEYS_WAITING(sp) || !F_ISSET(vp, VC_C1SET))) in set_txt_std()