Lines Matching +full:sw +full:- +full:reset +full:- +full:number
1 /*-
47 * ex_txt --
68 * to 0 -- text_init() handles this.) in ex_txt()
72 if (TAILQ_NEXT(tp, q) != NULL || tp->lb_len < 32) { in ex_txt()
76 tp->len = 0; in ex_txt()
83 /* Set the starting line number. */ in ex_txt()
84 tp->lno = sp->lno + 1; in ex_txt()
98 gp = sp->gp; in ex_txt()
104 if (v_txt_auto(sp, sp->lno, NULL, 0, tp)) in ex_txt()
114 /* Deal with all non-character events. */ in ex_txt()
142 * (Use tp->len, ignore overwrite and non-printable chars.) in ex_txt()
144 BINC_GOTOW(sp, tp->lb, tp->lb_len, tp->len + 1); in ex_txt()
150 * Historically, <carriage-return>'s in the command in ex_txt()
162 * '\' can escape <carriage-return>/<newline>. We 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()
195 ntp->lno = tp->lno + 1; in ex_txt()
198 * Reset the autoindent line value. 0^D keeps the ai in ex_txt()
214 OOBLNO, tp, tp->len, ntp)) 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()
262 * POSIX 1003.1b-1993, paragraph 7.1.1.9, states that 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()
302 leftmargin: (void)gp->scr_ex_adjust(sp, EX_TERM_CE); in ex_txt()
303 tp->ai = tp->len = 0; in ex_txt()
306 if (tp->len > tp->ai) in ex_txt()
317 (void)gp->scr_ex_adjust(sp, EX_TERM_CE); in ex_txt()
332 tp->lb[tp->len++] = ev.e_c; in ex_txt()
346 * txt_prompt --
347 * Display the ex prompt, line number, ai characters. Characters had
358 /* Display the line number. */ in txt_prompt()
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()
369 * txt_dent --
378 u_long sw, ts; in txt_dent() local
382 sw = O_VAL(sp, O_SHIFTWIDTH); in txt_dent()
385 for (off = scno = 0; off < tp->len; ++off) in txt_dent()
386 if (tp->lb[off] == '\t') in txt_dent()
392 cno = scno--; in txt_dent()
393 scno -= scno % sw; in txt_dent()
399 * number of columns because it's preceded by <space>s. This is in txt_dent()
411 spaces = scno - cno; 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()
422 for (; spaces > 0; --spaces) in txt_dent()
423 tp->lb[tp->len++] = ' '; in txt_dent()