Lines Matching refs:tp

224 #define	UPDATE_POSITION(sp, tp) do {					\  argument
225 (sp)->lno = (tp)->lno; \
226 (sp)->cno = (tp)->cno; \
251 TEXT *ntp, *tp; /* Input text structures. */ in v_txt() local
293 tp = TAILQ_FIRST(tiqh); in v_txt()
294 if (TAILQ_NEXT(tp, q) != NULL || in v_txt()
295 tp->lb_len < (len + 32) * sizeof(CHAR_T)) { in v_txt()
299 tp->ai = tp->insert = tp->offset = tp->owrite = 0; in v_txt()
301 tp->len = len; in v_txt()
302 BINC_RETW(sp, tp->lb, tp->lb_len, len); in v_txt()
303 MEMMOVE(tp->lb, lp, len); in v_txt()
305 tp->len = 0; in v_txt()
307 newtp: if ((tp = text_init(sp, lp, len, len + 32)) == NULL) in v_txt()
309 TAILQ_INSERT_HEAD(tiqh, tp, q); in v_txt()
313 tp->term = TERM_OK; in v_txt()
316 tp->lno = sp->lno; in v_txt()
317 tp->cno = sp->cno; in v_txt()
327 tp->owrite = (tm->cno - tp->cno) + 1; in v_txt()
328 tp->insert = (len - tm->cno) - 1; in v_txt()
330 tp->insert = len - tp->cno; in v_txt()
332 if (LF_ISSET(TXT_EMARK) && txt_emark(sp, tp, tm->cno)) in v_txt()
350 if (v_txt_auto(sp, ai_line, NULL, 0, tp)) in v_txt()
352 tp->cno = tp->ai; in v_txt()
360 tp->offset = 0; in v_txt()
361 tp->ai = tp->cno; in v_txt()
363 tp->offset = tp->cno; in v_txt()
368 tp->lb[tp->cno++] = prompt; in v_txt()
369 ++tp->len; in v_txt()
370 ++tp->offset; in v_txt()
384 tp->lb[tp->cno] = CH_CURSOR; in v_txt()
385 ++tp->len; in v_txt()
386 ++tp->insert; in v_txt()
387 (void)vs_change(sp, tp->lno, LINE_RESET); in v_txt()
467 UPDATE_POSITION(sp, tp); in v_txt()
562 if (L__cedit == 1 && (L__filec == 0 || tp->cno == tp->offset)) { in v_txt()
563 tp->term = TERM_CEDIT; in v_txt()
567 if (txt_fc(sp, tp, &filec_redraw)) in v_txt()
643 if (txt_hex(sp, tp)) in v_txt()
660 if (vs_change(sp, tp->lno, LINE_RESET)) in v_txt()
666 if (tp->cno <= tp->offset) in v_txt()
667 tp->term = TERM_CR; in v_txt()
674 tp->cno >= tp->offset + 1) in v_txt()
675 tp->term = TERM_SEARCH; in v_txt()
687 if (txt_abbrev(sp, tp, &evp->e_c, \ in v_txt()
700 txt_unmap(sp, tp, &ec_flags); \ in v_txt()
707 if (LF_ISSET(TXT_APPENDEOL) && tp->insert > 0) { \ in v_txt()
708 --tp->len; \ in v_txt()
709 --tp->insert; \ in v_txt()
718 tp->sv_len = tp->len; in v_txt()
719 tp->sv_cno = tp->cno; in v_txt()
720 tp->len = tp->cno; in v_txt()
723 if (vs_change(sp, tp->lno, LINE_RESET)) in v_txt()
735 tp->R_erase = 0; in v_txt()
736 owrite = tp->owrite; in v_txt()
737 insert = tp->insert; in v_txt()
739 for (p = tp->lb + tp->cno; owrite > 0 && isblank(*p); in v_txt()
740 ++p, --owrite, ++tp->R_erase); in v_txt()
743 ++p, ++tp->R_erase, --insert); in v_txt()
745 p = tp->lb + tp->cno + owrite; in v_txt()
766 ntp->lno = tp->lno + 1; in v_txt()
782 if (v_txt_auto(sp, OOBLNO, tp, tp->cno, ntp)) in v_txt()
820 tp = ntp; in v_txt()
821 if (vs_change(sp, tp->lno, LINE_INSERT)) in v_txt()
851 tp->insert = tp->owrite; in v_txt()
852 tp->owrite = 0; in v_txt()
859 if (tp->cno <= tp->offset) in v_txt()
860 tp->term = TERM_ESC; in v_txt()
866 if (FL_ISSET(is_flags, IS_RUNNING) && tp->cno >= tp->offset + 1) in v_txt()
867 tp->term = TERM_SEARCH; in v_txt()
876 txt_Rresolve(sp, sp->tiq, tp, len); in v_txt()
882 if (tp->owrite) { in v_txt()
883 if (tp->insert) in v_txt()
884 MEMMOVE(tp->lb + tp->cno, in v_txt()
885 tp->lb + tp->cno + tp->owrite, tp->insert); in v_txt()
886 tp->len -= tp->owrite; in v_txt()
902 BINC_GOTOW(sp, tp->lb, tp->lb_len, tp->len + 1); in v_txt()
903 tp->lb[tp->len] = '\0'; in v_txt()
910 if (tp->cno != 0) in v_txt()
911 --tp->cno; in v_txt()
914 if (vs_change(sp, tp->lno, LINE_RESET)) in v_txt()
918 if (tp->cno <= tp->ai && LF_ISSET(TXT_AUTOINDENT)) in v_txt()
922 if (tp->cno <= tp->ai && LF_ISSET(TXT_AUTOINDENT)) in v_txt()
935 if (tp->cno == 0) in v_txt()
940 if (tp->ai == 0 || tp->cno > tp->ai + tp->offset + 1) in v_txt()
946 BINC_GOTOW(sp, ait.lb, ait.lb_len, tp->ai); in v_txt()
947 MEMMOVE(ait.lb, tp->lb, tp->ai); in v_txt()
948 ait.ai = ait.len = tp->ai; in v_txt()
954 if (tp->ai == 0 || tp->cno > tp->ai + tp->offset + 1) in v_txt()
958 leftmargin: tp->lb[tp->cno - 1] = ' '; in v_txt()
959 tp->owrite += tp->cno - tp->offset; in v_txt()
960 tp->ai = 0; in v_txt()
961 tp->cno = tp->offset; in v_txt()
964 if (tp->ai == 0 || tp->cno > tp->ai + tp->offset) in v_txt()
967 (void)txt_dent(sp, tp, O_SHIFTWIDTH, 0); in v_txt()
975 if (tp->cno <= tp->offset && LF_ISSET(TXT_BS)) { in v_txt()
976 tp->term = TERM_BS; in v_txt()
984 if (tp->cno == 0) { in v_txt()
986 txt_backup(sp, sp->tiq, tp, &flags)) == NULL) in v_txt()
988 tp = ntp; in v_txt()
993 if (tp->cno <= tp->offset) { in v_txt()
1000 --tp->cno; in v_txt()
1013 tp->lb[tp->cno] = ' '; in v_txt()
1023 ++tp->owrite; in v_txt()
1024 if (tp->cno < tp->ai) in v_txt()
1025 --tp->ai; in v_txt()
1036 if (tp->cno == 0) { in v_txt()
1038 txt_backup(sp, sp->tiq, tp, &flags)) == NULL) in v_txt()
1040 tp = ntp; in v_txt()
1046 if (tp->cno <= tp->offset) { in v_txt()
1060 if (tp->ai && tp->cno > tp->ai) in v_txt()
1061 max = tp->ai; in v_txt()
1063 tp->ai = 0; in v_txt()
1064 max = tp->offset; in v_txt()
1068 while (tp->cno > max && ISBLANK(tp->lb[tp->cno - 1])) { in v_txt()
1069 --tp->cno; in v_txt()
1070 ++tp->owrite; in v_txt()
1072 if (tp->cno == max) in v_txt()
1096 while (tp->cno > max) { in v_txt()
1097 if (ISBLANK(tp->lb[tp->cno - 1])) in v_txt()
1099 --tp->cno; in v_txt()
1100 ++tp->owrite; in v_txt()
1102 tp->lb[tp->cno] = ' '; in v_txt()
1106 --tp->cno; in v_txt()
1107 ++tp->owrite; in v_txt()
1109 tp->lb[tp->cno] = ' '; in v_txt()
1111 if (tp->cno > max) in v_txt()
1112 tmp = inword(tp->lb[tp->cno - 1]); in v_txt()
1113 while (tp->cno > max) { in v_txt()
1114 if (tmp != inword(tp->lb[tp->cno - 1]) in v_txt()
1115 || ISBLANK(tp->lb[tp->cno - 1])) in v_txt()
1117 --tp->cno; in v_txt()
1118 ++tp->owrite; in v_txt()
1120 tp->lb[tp->cno] = ' '; in v_txt()
1135 if (tp->cno == 0) { in v_txt()
1137 txt_backup(sp, sp->tiq, tp, &flags)) == NULL) in v_txt()
1139 tp = ntp; in v_txt()
1143 if (tp->cno <= tp->offset) { in v_txt()
1157 if (tp->ai && tp->cno > tp->ai) in v_txt()
1158 max = tp->ai; in v_txt()
1160 tp->ai = 0; in v_txt()
1161 max = tp->offset; in v_txt()
1163 tp->owrite += tp->cno - max; in v_txt()
1171 tp->lb[--tp->cno] = ' '; in v_txt()
1172 } while (tp->cno > max); in v_txt()
1174 tp->cno = max; in v_txt()
1183 if (txt_dent(sp, tp, O_SHIFTWIDTH, 1)) in v_txt()
1210 if (txt_dent(sp, tp, O_TABSTOP, 1)) in v_txt()
1255 if (txt_abbrev(sp, tp, &evp->e_c, in v_txt()
1265 txt_unmap(sp, tp, &ec_flags); in v_txt()
1270 insl_ch: if (txt_insch(sp, tp, &evp->e_c, flags)) in v_txt()
1279 --tp->cno; in v_txt()
1280 ++tp->owrite; in v_txt()
1292 if (txt_hex(sp, tp)) in v_txt()
1311 if (txt_margin(sp, tp, &wmt, &tmp, flags)) in v_txt()
1328 ebuf_chk: if (tp->cno >= tp->len) { in v_txt()
1329 BINC_GOTOW(sp, tp->lb, tp->lb_len, tp->len + 1); in v_txt()
1332 tp->lb[tp->cno] = CH_CURSOR; in v_txt()
1333 ++tp->insert; in v_txt()
1334 ++tp->len; in v_txt()
1344 if (tp->cno + tp->insert + tp->owrite != tp->len) { in v_txt()
1347 tp->len, tp->cno, tp->ai, tp->insert, tp->owrite); in v_txt()
1350 tp->len = tp->cno + tp->insert + tp->owrite; in v_txt()
1368 vs_change(sp, tp->lno, LINE_RESET)) in v_txt()
1377 if (!KEYS_WAITING(sp) && txt_showmatch(sp, tp)) in v_txt()
1396 UPDATE_POSITION(sp, tp); in v_txt()
1402 if (FL_ISSET(is_flags, IS_RUNNING) && txt_isrch(sp, vp, tp, &is_flags)) in v_txt()
1422 vp->m_final.lno = tp->lno; in v_txt()
1423 vp->m_final.cno = tp->cno; in v_txt()
1439 txt_abbrev(SCR *sp, TEXT *tp, CHAR_T *pushcp, int isinfoline, int *didsubp, int *turnoffp) in txt_abbrev() argument
1448 if (tp->cno == tp->offset) in txt_abbrev()
1473 off = tp->cno - 1; /* Previous character. */ in txt_abbrev()
1474 p = tp->lb + off; in txt_abbrev()
1476 if (off == tp->offset || isblank(p[-1])) in txt_abbrev()
1481 if (off == tp->offset || !inword(p[-1])) in txt_abbrev()
1487 if (off == tp->offset || in txt_abbrev()
1531 if (off == tp->ai || off == tp->offset) in txt_abbrev()
1579 tp->cno -= len; in txt_abbrev()
1581 tp->owrite += len; in txt_abbrev()
1583 if (tp->insert) in txt_abbrev()
1584 MEMMOVE(tp->lb + tp->cno + qp->olen, in txt_abbrev()
1585 tp->lb + tp->cno + tp->owrite + len, tp->insert); in txt_abbrev()
1586 tp->owrite += qp->olen; in txt_abbrev()
1587 tp->len -= len - qp->olen; in txt_abbrev()
1606 txt_unmap(SCR *sp, TEXT *tp, u_int32_t *ec_flagsp) in txt_unmap() argument
1612 for (off = tp->cno - 1, p = tp->lb + off, len = 0;; --p, --off) { in txt_unmap()
1618 if (off == tp->ai || off == tp->offset) in txt_unmap()
1635 if ((off == tp->ai || off == tp->offset) && ex_is_unmap(p, len)) in txt_unmap()
1646 txt_ai_resolve(SCR *sp, TEXT *tp, int *changedp) in txt_ai_resolve() argument
1659 if (!tp->len || tp->offset || !tp->ai) in txt_ai_resolve()
1666 if (tp->len <= tp->ai) { in txt_ai_resolve()
1667 tp->ai = tp->cno = tp->len = 0; in txt_ai_resolve()
1679 for (p = tp->lb, scno = 0, len = tp->len, in txt_ai_resolve()
1712 old = p - tp->lb; in txt_ai_resolve()
1719 MEMMOVE(p - del, p, tp->len - old); in txt_ai_resolve()
1720 tp->len -= del; in txt_ai_resolve()
1721 tp->cno -= del; in txt_ai_resolve()
1724 for (p = tp->lb; tabs--;) in txt_ai_resolve()
1739 v_txt_auto(SCR *sp, recno_t lno, TEXT *aitp, size_t len, TEXT *tp) in v_txt_auto() argument
1751 tp->ai = 0; in v_txt_auto()
1769 BINC_RETW(sp, tp->lb, tp->lb_len, tp->len + nlen); in v_txt_auto()
1772 if (tp->len != 0) in v_txt_auto()
1773 MEMMOVE(tp->lb + nlen, tp->lb, tp->len); in v_txt_auto()
1774 tp->len += nlen; in v_txt_auto()
1777 MEMMOVE(tp->lb, t, nlen); in v_txt_auto()
1780 tp->ai = nlen; in v_txt_auto()
1789 txt_backup(SCR *sp, TEXTH *tiqh, TEXT *tp, u_int32_t *flagsp) in txt_backup() argument
1795 if ((ntp = TAILQ_PREV(tp, _texth, q)) == NULL) { in txt_backup()
1799 return (tp); in txt_backup()
1816 TAILQ_REMOVE(tiqh, tp, q); in txt_backup()
1817 text_free(tp); in txt_backup()
1864 txt_dent(SCR *sp, TEXT *tp, int swopt, int isindent) in txt_dent() argument
1890 for (current = cno = 0; cno < tp->cno; ++cno) in txt_dent()
1891 current += tp->lb[cno] == '\t' ? in txt_dent()
1892 COL_OFF(current, ts) : KEY_COL(sp, tp->lb[cno]); in txt_dent()
1910 ai_reset = !isindent || tp->cno == tp->ai + tp->offset; in txt_dent()
1917 for (; tp->cno > tp->offset && in txt_dent()
1918 (tp->lb[tp->cno - 1] == ' ' || tp->lb[tp->cno - 1] == '\t'); in txt_dent()
1919 --tp->cno, ++tp->owrite); in txt_dent()
1920 for (current = cno = 0; cno < tp->cno; ++cno) in txt_dent()
1921 current += tp->lb[cno] == '\t' ? in txt_dent()
1922 COL_OFF(current, ts) : KEY_COL(sp, tp->lb[cno]); in txt_dent()
1950 tp->ai = tabs + spaces; in txt_dent()
1957 (void)txt_insch(sp, tp, &ch, 0); in txt_dent()
1959 (void)txt_insch(sp, tp, &ch, 0); in txt_dent()
1968 txt_fc(SCR *sp, TEXT *tp, int *redrawp) in txt_fc() argument
1987 if (tp->cno == 1) { in txt_fc()
1989 p = tp->lb; in txt_fc()
1994 off = MAX(tp->ai, tp->offset), ap = tp->lb + off, p = ap; in txt_fc()
1995 off < tp->cno; ++off, ++ap) { in txt_fc()
1997 if (++off == tp->cno) in txt_fc()
2069 tp->cno -= len; in txt_fc()
2070 tp->owrite += len; in txt_fc()
2074 for (; nlen > 0 && tp->owrite > 0; --nlen, --tp->owrite, ++tp->cno) in txt_fc()
2079 off = p - tp->lb; in txt_fc()
2080 BINC_RETW(sp, tp->lb, tp->lb_len, tp->len + nlen); in txt_fc()
2081 p = tp->lb + off; in txt_fc()
2083 tp->cno += nlen; in txt_fc()
2084 tp->len += nlen; in txt_fc()
2086 if (tp->insert != 0) in txt_fc()
2087 (void)MEMMOVE(p + nlen, p, tp->insert); in txt_fc()
2104 if (tp->owrite == 0) { in txt_fc()
2105 off = p - tp->lb; in txt_fc()
2106 BINC_RETW(sp, tp->lb, tp->lb_len, tp->len + 1); in txt_fc()
2107 p = tp->lb + off; in txt_fc()
2108 if (tp->insert != 0) in txt_fc()
2109 (void)MEMMOVE(p + 1, p, tp->insert); in txt_fc()
2110 ++tp->len; in txt_fc()
2112 --tp->owrite; in txt_fc()
2114 ++tp->cno; in txt_fc()
2243 txt_emark(SCR *sp, TEXT *tp, size_t cno) in txt_emark() argument
2257 if (tp->lb[cno] == '\t') in txt_emark()
2258 (void)vs_columns(sp, tp->lb, tp->lno, &cno, &olen); in txt_emark()
2260 olen = KEY_COL(sp, tp->lb[cno]); in txt_emark()
2268 BINC_RETW(sp, tp->lb, tp->lb_len, tp->len + olen); in txt_emark()
2270 if (tp->insert != 0) in txt_emark()
2271 MEMMOVE(tp->lb + cno + 1 + chlen, in txt_emark()
2272 tp->lb + cno + 1, tp->insert); in txt_emark()
2274 tp->len += chlen; in txt_emark()
2275 tp->owrite += chlen; in txt_emark()
2276 p = tp->lb + cno; in txt_emark()
2277 if (tp->lb[cno] == '\t' || in txt_emark()
2278 KEY_NEEDSWIDE(sp, tp->lb[cno])) in txt_emark()
2283 KEY_NAME(sp, tp->lb[cno]), in txt_emark()
2287 tp->lb[cno] = ch; in txt_emark()
2288 return (vs_change(sp, tp->lno, LINE_RESET)); in txt_emark()
2329 txt_hex(SCR *sp, TEXT *tp) in txt_hex() argument
2341 savec = tp->lb[tp->cno]; in txt_hex()
2342 tp->lb[tp->cno] = 0; in txt_hex()
2345 for (off = tp->cno - 1, p = tp->lb + off, len = 0;; --p, --off, ++len) { in txt_hex()
2351 if (off == tp->ai || off == tp->offset) in txt_hex()
2363 nothex: tp->lb[tp->cno] = savec; in txt_hex()
2368 tp->lb[tp->cno] = savec; in txt_hex()
2371 tp->cno -= len; in txt_hex()
2372 tp->len -= len; in txt_hex()
2373 tp->lb[tp->cno - 1] = value; in txt_hex()
2376 if (tp->owrite) in txt_hex()
2377 MEMMOVE(tp->lb + tp->cno, tp->lb + tp->cno + len, in txt_hex()
2378 tp->owrite); in txt_hex()
2381 if (tp->insert) in txt_hex()
2382 MEMMOVE(tp->lb + tp->cno + tp->owrite, in txt_hex()
2383 tp->lb + tp->cno + tp->owrite + len, in txt_hex()
2384 tp->insert); in txt_hex()
2409 txt_insch(SCR *sp, TEXT *tp, CHAR_T *chp, u_int flags) in txt_insch() argument
2421 if (tp->owrite) { in txt_insch()
2422 --tp->owrite; in txt_insch()
2423 tp->lb[tp->cno++] = *chp; in txt_insch()
2426 } else if (tp->owrite) { /* Overwrite a character. */ in txt_insch()
2427 cno = tp->cno; in txt_insch()
2435 savech = tp->lb[cno]; in txt_insch()
2436 tp->lb[cno] = '\t'; in txt_insch()
2437 (void)vs_columns(sp, tp->lb, tp->lno, &cno, &nlen); in txt_insch()
2438 tp->lb[cno] = savech; in txt_insch()
2448 for (copydown = 0; nlen != 0 && tp->owrite != 0;) { in txt_insch()
2449 --tp->owrite; in txt_insch()
2451 if (tp->lb[cno] == '\t') in txt_insch()
2453 tp->lb, tp->lno, &cno, &olen); in txt_insch()
2455 olen = KEY_COL(sp, tp->lb[cno]); in txt_insch()
2466 tp->lb, tp->lb_len, tp->len + olen); in txt_insch()
2468 MEMMOVE(tp->lb + cno + 1 + chlen, in txt_insch()
2469 tp->lb + cno + 1, in txt_insch()
2470 tp->owrite + tp->insert); in txt_insch()
2472 tp->len += chlen; in txt_insch()
2473 tp->owrite += chlen; in txt_insch()
2474 if (tp->lb[cno] == '\t' || in txt_insch()
2475 KEY_NEEDSWIDE(sp, tp->lb[cno])) in txt_insch()
2476 for (p = tp->lb + cno + 1; chlen--;) in txt_insch()
2480 KEY_NAME(sp, tp->lb[cno]) + nlen, in txt_insch()
2481 p = tp->lb + cno + 1; chlen--;) in txt_insch()
2493 if (copydown != 0 && (tp->len -= copydown) != 0) in txt_insch()
2494 MEMMOVE(tp->lb + cno, tp->lb + cno + copydown, in txt_insch()
2495 tp->owrite + tp->insert + copydown); in txt_insch()
2499 tp->lb[tp->cno++] = *chp; in txt_insch()
2505 BINC_RETW(sp, tp->lb, tp->lb_len, tp->len + 1); in txt_insch()
2507 ++tp->len; in txt_insch()
2508 if (tp->insert) { /* Insert a character. */ in txt_insch()
2509 if (tp->insert == 1) in txt_insch()
2510 tp->lb[tp->cno + 1] = tp->lb[tp->cno]; in txt_insch()
2512 MEMMOVE(tp->lb + tp->cno + 1, in txt_insch()
2513 tp->lb + tp->cno, tp->owrite + tp->insert); in txt_insch()
2515 tp->lb[tp->cno++] = *chp; in txt_insch()
2524 txt_isrch(SCR *sp, VICMD *vp, TEXT *tp, u_int8_t *is_flagsp) in txt_isrch() argument
2540 if (tp->cno <= 1) { in txt_isrch()
2549 if (tp->lb[tp->cno - 1] == '\\' && in txt_isrch()
2550 (tp->cno == 2 || tp->lb[tp->cno - 2] != '\\')) in txt_isrch()
2557 if (IS_SHELLMETA(sp, tp->lb[tp->cno - 1]) && in txt_isrch()
2558 (tp->cno == 2 || tp->lb[tp->cno - 2] != '\\')) in txt_isrch()
2568 if (tp->lb[0] == tp->lb[tp->cno - 1] && in txt_isrch()
2569 (tp->cno == 2 || tp->lb[tp->cno - 2] != '\\')) { in txt_isrch()
2579 lno = tp->lno; in txt_isrch()
2600 if (tp->lb[0] == '/' ? in txt_isrch()
2602 &start, &vp->m_final, tp->lb + 1, tp->cno - 1, NULL, sf) : in txt_isrch()
2604 &start, &vp->m_final, tp->lb + 1, tp->cno - 1, NULL, sf)) { in txt_isrch()
2621 tp->lno = TMAP[0].lno; in txt_isrch()
2647 TEXT *tp; in txt_resolve() local
2659 tp = TAILQ_FIRST(tiqh); in txt_resolve()
2662 txt_ai_resolve(sp, tp, &changed); in txt_resolve()
2665 if (db_set(sp, tp->lno, tp->lb, tp->len) || in txt_resolve()
2666 (changed && vs_change(sp, tp->lno, LINE_RESET))) in txt_resolve()
2669 for (lno = tp->lno; (tp = TAILQ_NEXT(tp, q)) != NULL; ++lno) { in txt_resolve()
2671 txt_ai_resolve(sp, tp, &changed); in txt_resolve()
2674 if (db_append(sp, 0, lno, tp->lb, tp->len) || in txt_resolve()
2675 (changed && vs_change(sp, tp->lno, LINE_RESET))) in txt_resolve()
2698 txt_showmatch(SCR *sp, TEXT *tp) in txt_showmatch() argument
2711 UPDATE_POSITION(sp, tp); in txt_showmatch()
2723 cs.cs_lno = tp->lno; in txt_showmatch()
2724 cs.cs_cno = tp->cno - 1; in txt_showmatch()
2765 txt_margin(SCR *sp, TEXT *tp, TEXT *wmtp, int *didbreak, u_int32_t flags) in txt_margin() argument
2772 for (off = tp->cno - 1, p = tp->lb + off, len = 0;; --off, --p, ++len) { in txt_margin()
2787 if (off == tp->ai || off == tp->offset) { in txt_margin()
2806 wmtp->insert = LF_ISSET(TXT_APPENDEOL) ? tp->insert - 1 : tp->insert; in txt_margin()
2807 wmtp->owrite = tp->owrite; in txt_margin()
2810 tp->cno -= len; in txt_margin()
2812 tp->len -= len + tp->owrite + (tp->insert - 1); in txt_margin()
2813 tp->insert = 1; in txt_margin()
2815 tp->len -= len + tp->owrite + tp->insert; in txt_margin()
2816 tp->insert = 0; in txt_margin()
2818 tp->owrite = 0; in txt_margin()
2827 --tp->cno; in txt_margin()
2828 --tp->len; in txt_margin()
2829 if (off == tp->ai || off == tp->offset) in txt_margin()
2841 txt_Rresolve(SCR *sp, TEXTH *tiqh, TEXT *tp, const size_t orig_len) in txt_Rresolve() argument
2851 if (tp->owrite == 0) in txt_Rresolve()
2859 input_len += ttp == tp ? tp->cno : ttp->len + ttp->R_erase; in txt_Rresolve()
2879 retain = MIN(tp->owrite, orig_len - input_len); in txt_Rresolve()
2883 MEMCPY(tp->lb + tp->cno, p + input_len, retain); in txt_Rresolve()
2884 tp->len -= tp->owrite - retain; in txt_Rresolve()
2885 tp->owrite = 0; in txt_Rresolve()
2886 tp->insert += retain; in txt_Rresolve()