Lines Matching defs:tp

57 	TEXT ait, *ntp, *tp;
71 tp = TAILQ_FIRST(tiqh);
72 if (TAILQ_NEXT(tp, q) != NULL || tp->lb_len < 32) {
76 tp->len = 0;
78 newtp: if ((tp = text_init(sp, NULL, 0, 32)) == NULL)
80 TAILQ_INSERT_HEAD(tiqh, tp, q);
84 tp->lno = sp->lno + 1;
104 if (v_txt_auto(sp, sp->lno, NULL, 0, tp))
107 txt_prompt(sp, tp, prompt, flags);
142 * (Use tp->len, ignore overwrite and non-printable chars.)
144 BINC_GOTOW(sp, tp->lb, tp->lb_len, tp->len + 1);
167 tp->len != 0 && tp->lb[tp->len - 1] == '\\')
177 tp->lb[tp->len] = '\0';
185 if (LF_ISSET(TXT_DOTTERM) && tp->len == tp->ai + 1 &&
186 tp->lb[tp->len - 1] == '.') {
187 notlast: TAILQ_REMOVE(tiqh, tp, q);
188 text_free(tp);
195 ntp->lno = tp->lno + 1;
201 * using the current tp structure, use the cursor as
214 OOBLNO, tp, tp->len, ntp))
224 tp = ntp;
225 TAILQ_INSERT_TAIL(tiqh, tp, q);
228 if (tp->len <= tp->ai && LF_ISSET(TXT_AUTOINDENT))
232 if (tp->len <= tp->ai && LF_ISSET(TXT_AUTOINDENT))
244 for (cnt = 0; cnt < tp->len; ++cnt)
245 if (!isblank(tp->lb[cnt]))
247 if (cnt == tp->len) {
248 tp->len = 1;
249 tp->lb[0] = ev.e_c;
250 tp->lb[1] = '\0';
280 if (!LF_ISSET(TXT_AUTOINDENT) || tp->len == 0)
284 if (tp->len > tp->ai + 1)
290 BINC_GOTOW(sp, ait.lb, ait.lb_len, tp->ai);
291 MEMCPY(ait.lb, tp->lb, tp->ai);
292 ait.ai = ait.len = tp->ai;
298 if (tp->len > tp->ai + 1)
303 tp->ai = tp->len = 0;
306 if (tp->len > tp->ai)
309 if (txt_dent(sp, tp))
318 txt_prompt(sp, tp, prompt, flags);
332 tp->lb[tp->len++] = ev.e_c;
352 txt_prompt(SCR *sp, TEXT *tp, ARG_CHAR_T prompt, u_int32_t flags)
360 (void)ex_printf(sp, "%6lu ", (u_long)tp->lno);
364 (void)ex_printf(sp, WVS, (int)tp->ai, tp->lb);
376 txt_dent(SCR *sp, TEXT *tp)
385 for (off = scno = 0; off < tp->len; ++off)
386 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++] = ' ';