Lines Matching defs:cno
76 vp->m_final.cno = sp->cno;
84 sp->cno = 0;
113 sp->cno = vp->m_final.cno;
232 * Internally, we maintain tp->lno and tp->cno, externally, everyone uses
233 * sp->lno and sp->cno. Make them consistent as necessary.
237 (sp)->cno = (tp)->cno; \
329 tp->cno = sp->cno;
339 tp->owrite = (tm->cno - tp->cno) + 1;
340 tp->insert = (len - tm->cno) - 1;
342 tp->insert = len - tp->cno;
344 if (LF_ISSET(TXT_EMARK) && txt_emark(sp, tp, tm->cno))
364 tp->cno = tp->ai;
373 tp->ai = tp->cno;
375 tp->offset = tp->cno;
380 tp->lb[tp->cno++] = prompt;
396 tp->lb[tp->cno] = CH_CURSOR;
577 if (L__cedit == 1 && (L__filec == 0 || tp->cno == tp->offset)) {
648 --tp->cno;
691 if (tp->cno <= tp->offset)
699 tp->cno >= tp->offset + 1)
744 tp->sv_cno = tp->cno;
745 tp->len = tp->cno;
764 for (p = tp->lb + tp->cno; owrite > 0 && ISBLANK((UCHAR_T)*p);
770 p = tp->lb + tp->cno + owrite;
807 if (v_txt_auto(sp, OOBLNO, tp, tp->cno, ntp))
813 ntp->cno = ntp->ai;
826 MEMMOVEW(ntp->lb + ntp->cno, wmt.lb, WMTSPACE);
828 ntp->cno += wmt.offset;
839 ntp->lb[ntp->cno] = CH_CURSOR;
884 if (tp->cno <= tp->offset)
891 if (FL_ISSET(is_flags, IS_RUNNING) && tp->cno >= tp->offset + 1)
909 MEMMOVEW(tp->lb + tp->cno,
910 tp->lb + tp->cno + tp->owrite, tp->insert);
935 if (tp->cno != 0)
936 --tp->cno;
943 if (tp->cno <= tp->ai && LF_ISSET(TXT_AUTOINDENT))
947 if (tp->cno <= tp->ai && LF_ISSET(TXT_AUTOINDENT))
960 if (tp->cno == 0)
965 if (tp->ai == 0 || tp->cno != tp->ai + tp->offset + 1)
979 if (tp->ai == 0 || tp->cno != tp->ai + tp->offset + 1)
983 leftmargin: tp->lb[tp->cno - 1] = ' ';
984 tp->owrite += tp->cno - tp->offset;
985 tp->cno = tp->offset;
988 if (tp->ai == 0 || tp->cno != tp->ai + tp->offset)
999 if (tp->cno <= tp->offset && LF_ISSET(TXT_BS)) {
1008 if (tp->cno == 0) {
1017 if (tp->cno <= tp->offset) {
1024 --tp->cno;
1037 tp->lb[tp->cno] = ' ';
1048 if (tp->cno < tp->ai)
1060 if (tp->cno == 0) {
1070 if (tp->cno <= tp->offset) {
1084 if (tp->ai && tp->cno > tp->ai)
1092 while (tp->cno > max && ISBLANK((UCHAR_T)tp->lb[tp->cno - 1])) {
1093 --tp->cno;
1096 if (tp->cno == max)
1120 while (tp->cno > max) {
1121 if (ISBLANK((UCHAR_T)tp->lb[tp->cno - 1]))
1123 --tp->cno;
1126 tp->lb[tp->cno] = ' ';
1130 --tp->cno; /* No worry for out of bounds. */
1133 tp->lb[tp->cno] = ' ';
1135 if (tp->cno > max)
1136 tmp = inword((UCHAR_T)tp->lb[tp->cno - 1]);
1137 while (tp->cno > max) {
1138 if (tmp != inword((UCHAR_T)tp->lb[tp->cno - 1])
1139 || ISBLANK((UCHAR_T)tp->lb[tp->cno - 1]))
1141 --tp->cno;
1144 tp->lb[tp->cno] = ' ';
1159 if (tp->cno == 0) {
1167 if (tp->cno <= tp->offset) {
1181 if (tp->ai && tp->cno > tp->ai)
1187 tp->owrite += tp->cno - max;
1195 tp->lb[--tp->cno] = ' ';
1196 } while (tp->cno > max);
1198 tp->cno = max;
1317 --tp->cno;
1366 ebuf_chk: if (tp->cno >= tp->len) {
1370 tp->lb[tp->cno] = CH_CURSOR;
1386 if (tp->cno + tp->insert + tp->owrite != tp->len) {
1388 "len %u != cno: %u ai: %u insert %u overwrite %u",
1389 tp->len, tp->cno, tp->ai, tp->insert, tp->owrite);
1392 tp->len = tp->cno + tp->insert + tp->owrite;
1465 vp->m_final.cno = tp->cno;
1489 if (tp->cno == tp->offset)
1512 off = tp->cno - 1; /* Previous character. */
1618 tp->cno -= len;
1623 MEMMOVEW(tp->lb + tp->cno + qp->olen,
1624 tp->lb + tp->cno + tp->owrite + len, tp->insert);
1651 for (off = tp->cno - 1, p = tp->lb + off, len = 0;; --p, --off) {
1689 size_t cno, len, new, old, scno, spaces, tab_after_sp, tabs;
1706 tp->ai = tp->cno = tp->len = 0;
1739 cno = 0;
1742 for (; cno + COL_OFF(cno, ts) <= scno; ++tabs)
1743 cno += COL_OFF(cno, ts);
1745 spaces = scno - cno;
1760 tp->cno -= delc;
1905 size_t cno, current, spaces, target, tabs;
1926 for (current = cno = 0; cno < tp->cno; ++cno)
1927 current += tp->lb[cno] == '\t' ?
1928 COL_OFF(current, ts) : KEY_COL(sp, tp->lb[cno]);
1943 for (; tp->cno > tp->offset &&
1944 (tp->lb[tp->cno - 1] == ' ' || tp->lb[tp->cno - 1] == '\t');
1945 --tp->cno, ++tp->owrite);
1946 for (current = cno = 0; cno < tp->cno; ++cno)
1947 current += tp->lb[cno] == '\t' ?
1948 COL_OFF(current, ts) : KEY_COL(sp, tp->lb[cno]);
1965 cno = current;
1968 for (; cno + COL_OFF(cno, ts) <= target; ++tabs)
1969 cno += COL_OFF(cno, ts);
1971 spaces = target - cno;
2011 if (tp->cno == 1) {
2016 off = tp->cno - 1, p = tp->lb + off;; --off, --p) {
2098 tp->cno -= len;
2103 for (; nlen > 0 && tp->owrite > 0; --nlen, --tp->owrite, ++tp->cno)
2112 tp->cno += nlen;
2134 ++tp->cno;
2266 txt_emark(SCR *sp, TEXT *tp, size_t cno)
2280 if (tp->lb[cno] == '\t')
2281 (void)vs_columns(sp, tp->lb, tp->lno, &cno, &olen);
2283 olen = KEY_COL(sp, tp->lb[cno]);
2294 MEMMOVEW(tp->lb + cno + 1 + chlen,
2295 tp->lb + cno + 1, tp->insert);
2299 p = tp->lb + cno;
2300 if (tp->lb[cno] == '\t')
2301 for (cno += chlen; chlen--;)
2303 else if (INTISWIDE(tp->lb[cno])) {
2309 cno++;
2313 for (cno += chlen; chlen--;)
2316 for (kp = KEY_NAME(sp, tp->lb[cno]),
2317 cno += chlen; chlen--;)
2320 tp->lb[cno] = ch;
2346 sp->cno = 0;
2374 savec = tp->lb[tp->cno];
2375 tp->lb[tp->cno] = 0;
2378 for (off = tp->cno - 1, p = tp->lb + off, len = 0;; --p, --off, ++len) {
2396 nothex: tp->lb[tp->cno] = savec;
2401 tp->lb[tp->cno] = savec;
2404 tp->cno -= len;
2406 tp->lb[tp->cno - 1] = value;
2410 MEMMOVEW(tp->lb + tp->cno, tp->lb + tp->cno + len,
2415 MEMMOVEW(tp->lb + tp->cno + tp->owrite,
2416 tp->lb + tp->cno + tp->owrite + len,
2446 size_t chlen, cno, copydown, olen, nlen;
2456 tp->lb[tp->cno++] = (UCHAR_T)*chp;
2460 cno = tp->cno;
2468 savech = tp->lb[cno];
2469 tp->lb[cno] = '\t';
2470 (void)vs_columns(sp, tp->lb, tp->lno, &cno, &nlen);
2471 tp->lb[cno] = savech;
2484 if (tp->lb[cno] == '\t')
2486 tp->lb, tp->lno, &cno, &olen);
2488 olen = KEY_COL(sp, tp->lb[cno]);
2501 MEMMOVEW(tp->lb + cno + 1 + chlen,
2502 tp->lb + cno + 1,
2511 if (tp->lb[cno] == '\t'
2512 || INTISWIDE(tp->lb[cno]))
2513 for (p = tp->lb + cno + 1; chlen--;)
2517 KEY_NAME(sp, tp->lb[cno]) + nlen,
2518 p = tp->lb + cno + 1; chlen--;)
2531 MEMMOVEW(tp->lb + cno, tp->lb + cno + copydown,
2536 tp->lb[tp->cno++] = (UCHAR_T)*chp;
2547 tp->lb[tp->cno + 1] = tp->lb[tp->cno];
2549 MEMMOVEW(tp->lb + tp->cno + 1,
2550 tp->lb + tp->cno, tp->owrite + tp->insert);
2552 tp->lb[tp->cno++] = (UCHAR_T)*chp;
2577 if (tp->cno <= 1) {
2586 if (tp->lb[tp->cno - 1] == '\\' &&
2587 (tp->cno == 2 || tp->lb[tp->cno - 2] != '\\'))
2594 if (strchr(O_STR(sp, O_SHELLMETA), tp->lb[tp->cno - 1]) != NULL &&
2595 (tp->cno == 2 || tp->lb[tp->cno - 2] != '\\'))
2605 if (tp->lb[0] == tp->lb[tp->cno - 1] &&
2606 (tp->cno == 2 || tp->lb[tp->cno - 2] != '\\')) {
2639 &start, &vp->m_final, tp->lb + 1, tp->cno - 1, NULL, sf) :
2641 &start, &vp->m_final, tp->lb + 1, tp->cno - 1, NULL, sf)) {
2643 sp->cno = vp->m_final.cno;
2756 cs.cs_cno = tp->cno - 1;
2780 if (cs.cs_lno < m.lno || (cs.cs_lno == m.lno && cs.cs_cno < m.cno))
2783 sp->cno = cs.cs_cno;
2803 for (off = tp->cno - 1, p = tp->lb + off, len = 0;; --off, --p, ++len) {
2839 tp->cno -= len;
2856 --tp->cno;
2888 input_len += ttp == tp ? tp->cno : ttp->len + ttp->R_erase;
2912 MEMCPYW(tp->lb + tp->cno, p + input_len, retain);