Lines Matching +full:vp +full:- +full:p

1 /*-
27 * v_match -- %
33 v_match(SCR *sp, VICMD *vp) in v_match() argument
39 CHAR_T *p; in v_match() local
49 match_chars = VIP(sp)->mcs; in v_match()
59 if (db_eget(sp, vp->m_start.lno, &p, &len, &isempty)) { in v_match()
64 for (off = vp->m_start.cno;; ++off) { in v_match()
69 startc = p[off]; in v_match()
72 cnt = cp - match_chars; in v_match()
79 cs.cs_lno = vp->m_start.lno; in v_match()
93 else if (cs.cs_ch == matchc && --cnt == 0) in v_match()
101 vp->m_stop.lno = cs.cs_lno; in v_match()
102 vp->m_stop.cno = cs.cs_cno; in v_match()
105 * If moving right, non-motion commands move to the end of the range. in v_match()
111 * Don't correct for leftward movement -- historic vi deleted the in v_match()
114 if (vp->m_start.lno < vp->m_stop.lno || in v_match()
115 (vp->m_start.lno == vp->m_stop.lno && in v_match()
116 vp->m_start.cno < vp->m_stop.cno)) in v_match()
117 vp->m_final = ISMOTION(vp) ? vp->m_start : vp->m_stop; in v_match()
119 vp->m_final = vp->m_stop; in v_match()
124 * is at or before any non-blank characters in the line, i.e. the in v_match()
129 if (!ISMOTION(vp) || vp->m_start.lno == vp->m_stop.lno) in v_match()
131 mp = vp->m_start.lno < vp->m_stop.lno ? &vp->m_start : &vp->m_stop; in v_match()
132 if (mp->cno != 0) { in v_match()
134 if (nonblank(sp, mp->lno, &cno)) in v_match()
136 if (cno < mp->cno) in v_match()
139 mp = vp->m_start.lno < vp->m_stop.lno ? &vp->m_stop : &vp->m_start; in v_match()
140 if (db_get(sp, mp->lno, DBG_FATAL, &p, &len)) in v_match()
142 for (p += mp->cno + 1, len -= mp->cno; --len; ++p) in v_match()
143 if (!isblank(*p)) in v_match()
145 F_SET(vp, VM_LMODE); in v_match()
150 * v_buildmcs --
158 CHAR_T **mp = &VIP(sp)->mcs; in v_buildmcs()
166 if (mbstowcs(*mp, str, len) == (size_t)-1) in v_buildmcs()