Lines Matching refs:tp

61 	TEXT ait, *ntp, *tp;
75 tp = TAILQ_FIRST(tiqh);
76 if (TAILQ_NEXT(tp, q) != NULL || tp->lb_len < 32) {
80 tp->len = 0;
82 newtp: if ((tp = text_init(sp, NULL, 0, 32)) == NULL)
84 TAILQ_INSERT_HEAD(tiqh, tp, q);
88 tp->lno = sp->lno + 1;
108 if (v_txt_auto(sp, sp->lno, NULL, 0, tp))
111 txt_prompt(sp, tp, prompt, flags);
146 * (Use tp->len, ignore overwrite and non-printable chars.)
148 BINC_GOTOW(sp, tp->lb, tp->lb_len, tp->len + 1);
171 tp->len != 0 && tp->lb[tp->len - 1] == '\\')
181 tp->lb[tp->len] = '\0';
189 if (LF_ISSET(TXT_DOTTERM) && tp->len == tp->ai + 1 &&
190 tp->lb[tp->len - 1] == '.') {
191 notlast: TAILQ_REMOVE(tiqh, tp, q);
192 text_free(tp);
199 ntp->lno = tp->lno + 1;
205 * using the current tp structure, use the cursor as
218 OOBLNO, tp, tp->len, ntp))
228 tp = ntp;
229 TAILQ_INSERT_TAIL(tiqh, tp, q);
232 if (tp->len <= tp->ai && LF_ISSET(TXT_AUTOINDENT))
236 if (tp->len <= tp->ai && LF_ISSET(TXT_AUTOINDENT))
248 for (cnt = 0; cnt < tp->len; ++cnt)
249 if (!isblank(tp->lb[cnt]))
251 if (cnt == tp->len) {
252 tp->len = 1;
253 tp->lb[0] = ev.e_c;
254 tp->lb[1] = '\0';
284 if (!LF_ISSET(TXT_AUTOINDENT) || tp->len == 0)
288 if (tp->len > tp->ai + 1)
294 BINC_GOTOW(sp, ait.lb, ait.lb_len, tp->ai);
295 MEMCPY(ait.lb, tp->lb, tp->ai);
296 ait.ai = ait.len = tp->ai;
302 if (tp->len > tp->ai + 1)
307 tp->ai = tp->len = 0;
310 if (tp->len > tp->ai)
313 if (txt_dent(sp, tp))
322 txt_prompt(sp, tp, prompt, flags);
336 tp->lb[tp->len++] = ev.e_c;
356 txt_prompt(SCR *sp, TEXT *tp, ARG_CHAR_T prompt, u_int32_t flags)
364 (void)ex_printf(sp, "%6lu ", (u_long)tp->lno);
368 (void)ex_printf(sp, WVS, (int)tp->ai, tp->lb);
380 txt_dent(SCR *sp, TEXT *tp)
389 for (off = scno = 0; off < tp->len; ++off)
390 if (tp->lb[off] == '\t')
414 BINC_RETW(sp, tp->lb, tp->lb_len, tabs + spaces + 1);
417 tp->ai = tabs + spaces;
420 for (tp->len = 0; tabs > 0; --tabs)
421 tp->lb[tp->len++] = '\t';
423 tp->lb[tp->len++] = ' ';