Lines Matching refs:tp

57 	TEXT ait, *ntp, *tp;  in ex_txt()  local
71 tp = TAILQ_FIRST(tiqh); in ex_txt()
72 if (TAILQ_NEXT(tp, q) != NULL || tp->lb_len < 32) { in ex_txt()
76 tp->len = 0; in ex_txt()
78 newtp: if ((tp = text_init(sp, NULL, 0, 32)) == NULL) in ex_txt()
80 TAILQ_INSERT_HEAD(tiqh, tp, q); in ex_txt()
84 tp->lno = sp->lno + 1; in ex_txt()
104 if (v_txt_auto(sp, sp->lno, NULL, 0, tp)) in ex_txt()
107 txt_prompt(sp, tp, prompt, flags); in ex_txt()
144 BINC_GOTOW(sp, tp->lb, tp->lb_len, tp->len + 1); in ex_txt()
167 tp->len != 0 && tp->lb[tp->len - 1] == '\\') in ex_txt()
177 tp->lb[tp->len] = '\0'; in ex_txt()
185 if (LF_ISSET(TXT_DOTTERM) && tp->len == tp->ai + 1 && in ex_txt()
186 tp->lb[tp->len - 1] == '.') { in ex_txt()
187 notlast: TAILQ_REMOVE(tiqh, tp, q); in ex_txt()
188 text_free(tp); in ex_txt()
195 ntp->lno = tp->lno + 1; in ex_txt()
214 OOBLNO, tp, tp->len, ntp)) in ex_txt()
224 tp = ntp; in ex_txt()
225 TAILQ_INSERT_TAIL(tiqh, tp, q); in ex_txt()
228 if (tp->len <= tp->ai && LF_ISSET(TXT_AUTOINDENT)) in ex_txt()
232 if (tp->len <= tp->ai && LF_ISSET(TXT_AUTOINDENT)) in ex_txt()
244 for (cnt = 0; cnt < tp->len; ++cnt) in ex_txt()
245 if (!isblank(tp->lb[cnt])) in ex_txt()
247 if (cnt == tp->len) { in ex_txt()
248 tp->len = 1; in ex_txt()
249 tp->lb[0] = ev.e_c; in ex_txt()
250 tp->lb[1] = '\0'; in ex_txt()
280 if (!LF_ISSET(TXT_AUTOINDENT) || tp->len == 0) in ex_txt()
284 if (tp->len > tp->ai + 1) in ex_txt()
290 BINC_GOTOW(sp, ait.lb, ait.lb_len, tp->ai); in ex_txt()
291 MEMCPY(ait.lb, tp->lb, tp->ai); in ex_txt()
292 ait.ai = ait.len = tp->ai; in ex_txt()
298 if (tp->len > tp->ai + 1) in ex_txt()
303 tp->ai = tp->len = 0; in ex_txt()
306 if (tp->len > tp->ai) in ex_txt()
309 if (txt_dent(sp, tp)) in ex_txt()
318 txt_prompt(sp, tp, prompt, flags); in ex_txt()
332 tp->lb[tp->len++] = ev.e_c; in ex_txt()
352 txt_prompt(SCR *sp, TEXT *tp, ARG_CHAR_T prompt, u_int32_t flags) in txt_prompt() argument
360 (void)ex_printf(sp, "%6lu ", (u_long)tp->lno); in txt_prompt()
364 (void)ex_printf(sp, WVS, (int)tp->ai, tp->lb); in txt_prompt()
376 txt_dent(SCR *sp, TEXT *tp) in txt_dent() argument
385 for (off = scno = 0; off < tp->len; ++off) in txt_dent()
386 if (tp->lb[off] == '\t') in txt_dent()
414 BINC_RETW(sp, tp->lb, tp->lb_len, tabs + spaces + 1); in txt_dent()
417 tp->ai = tabs + spaces; in txt_dent()
420 for (tp->len = 0; tabs > 0; --tabs) in txt_dent()
421 tp->lb[tp->len++] = '\t'; in txt_dent()
423 tp->lb[tp->len++] = ' '; in txt_dent()