Lines Matching +full:display +full:- +full:rows
1 /*-
32 * -- only wait if the screen is full
43 * vs_busy --
44 * Display, update or clear a busy message.
59 static const char flagc[] = "|/-\\"; in vs_busy()
65 /* Ex doesn't display busy messages. */ in vs_busy()
69 gp = sp->gp; in vs_busy()
80 ++vip->busy_ref; in vs_busy()
81 if (vip->totalcount != 0 || vip->busy_ref != 1) in vs_busy()
85 vip->busy_ch = 0; in vs_busy()
86 timepoint_steady(&vip->busy_ts); in vs_busy()
89 (void)gp->scr_cursor(sp, &vip->busy_oldy, &vip->busy_oldx); in vs_busy()
91 /* Display the busy message. */ in vs_busy()
93 (void)gp->scr_move(sp, LASTLINE(sp), 0); in vs_busy()
94 (void)gp->scr_addstr(sp, p, len); in vs_busy()
95 (void)gp->scr_cursor(sp, ¬used, &vip->busy_fx); in vs_busy()
96 (void)gp->scr_clrtoeol(sp); in vs_busy()
97 (void)gp->scr_move(sp, LASTLINE(sp), vip->busy_fx); in vs_busy()
100 if (vip->busy_ref == 0) in vs_busy()
102 --vip->busy_ref; in vs_busy()
108 if (vip->totalcount == 0 && vip->busy_ref == 0) { in vs_busy()
109 (void)gp->scr_move(sp, LASTLINE(sp), 0); in vs_busy()
110 (void)gp->scr_clrtoeol(sp); in vs_busy()
112 (void)gp->scr_move(sp, vip->busy_oldy, vip->busy_oldx); in vs_busy()
115 if (vip->totalcount != 0 || vip->busy_ref == 0) in vs_busy()
121 timespecsub(&ts_diff, &vip->busy_ts); in vs_busy()
124 vip->busy_ts = ts; in vs_busy()
126 /* Display the update. */ in vs_busy()
127 if (vip->busy_ch == sizeof(flagc) - 1) in vs_busy()
128 vip->busy_ch = 0; in vs_busy()
129 (void)gp->scr_move(sp, LASTLINE(sp), vip->busy_fx); in vs_busy()
130 (void)gp->scr_addstr(sp, flagc + vip->busy_ch++, 1); in vs_busy()
131 (void)gp->scr_move(sp, LASTLINE(sp), vip->busy_fx); in vs_busy()
134 (void)gp->scr_refresh(sp, 0); in vs_busy()
138 * vs_home --
139 * Home the cursor to the bottom row, left-most column.
146 (void)sp->gp->scr_move(sp, LASTLINE(sp), 0); in vs_home()
147 (void)sp->gp->scr_refresh(sp, 0); in vs_home()
151 * vs_update --
164 gp = sp->gp; in vs_update()
183 * Save the cursor position, the substitute-with-confirmation code in vs_update()
186 (void)gp->scr_cursor(sp, &oldy, &oldx); in vs_update()
189 (void)gp->scr_move(sp, LASTLINE(sp), 0); in vs_update()
190 (void)gp->scr_clrtoeol(sp); in vs_update()
198 if (len > sp->cols - 2) in vs_update()
199 mlen = len = sp->cols - 2; in vs_update()
200 (void)gp->scr_addstr(sp, m1, mlen); in vs_update()
205 if (len + mlen > sp->cols - 2) in vs_update()
206 mlen = (sp->cols - 2) - len; in vs_update()
207 (void)gp->scr_waddstr(sp, m2, mlen); in vs_update()
210 (void)gp->scr_move(sp, oldy, oldx); in vs_update()
211 (void)gp->scr_refresh(sp, 0); in vs_update()
215 * vs_msg --
216 * Display ex output or error messages for the screen.
234 gp = sp->gp; in vs_msg()
246 (void)gp->scr_bell(sp); in vs_msg()
253 * real-estate for the error message. Nothing to do without some in vs_msg()
271 * If the SC_EX_WAIT_NO bit is set, turn it off -- we're writing to in vs_msg()
277 if (sp->gp->scr_screen(sp, SC_EX)) in vs_msg()
285 (void)gp->scr_attr(sp, SA_INVERSE, 1); in vs_msg()
288 (void)gp->scr_attr(sp, SA_INVERSE, 0); in vs_msg()
294 (void)sp->gp->scr_screen(sp, SC_VI); in vs_msg()
305 (void)gp->scr_cursor(sp, &oldy, &oldx); in vs_msg()
317 if (line[len - 1] == '\n') in vs_msg()
318 --len; in vs_msg()
325 * Need up to two padding characters normally; a semi-colon and a in vs_msg()
330 * Assume that periods and semi-colons take up a single column on the in vs_msg()
343 maxcols = sp->cols - 1; in vs_msg()
344 if (vip->lcontinue != 0) { in vs_msg()
345 if (len + vip->lcontinue + padding > maxcols) in vs_msg()
346 vs_output(sp, vip->mtype, ".\n", 2); in vs_msg()
348 vs_output(sp, vip->mtype, ";", 1); in vs_msg()
352 vip->mtype = mtype; in vs_msg()
354 for (; len > 0 && isblank((u_char)*s); --len, ++s); in vs_msg()
357 if (len + vip->lcontinue > maxcols) { in vs_msg()
358 for (e = s + (maxcols - vip->lcontinue); in vs_msg()
359 e > s && !isblank((u_char)*e); --e); in vs_msg()
361 e = t = s + (maxcols - vip->lcontinue); in vs_msg()
363 for (t = e; isblank((u_char)e[-1]); --e); in vs_msg()
371 len -= t - s; in vs_msg()
372 if (len == 0 && (e - s) > 1 && s[(e - s) - 1] == '.') in vs_msg()
373 --e; in vs_msg()
374 vs_output(sp, mtype, s, e - s); in vs_msg()
383 ret: (void)gp->scr_move(sp, oldy, oldx); in vs_msg()
384 (void)gp->scr_refresh(sp, 0); in vs_msg()
388 * vs_output --
401 gp = sp->gp; in vs_output()
408 len = p - line; in vs_output()
411 * The max is sp->cols characters, and we may have already in vs_output()
414 if (len + vip->lcontinue > sp->cols) in vs_output()
415 len = sp->cols - vip->lcontinue; in vs_output()
423 if (vip->lcontinue == 0) { in vs_output()
425 if (vip->totalcount == 1) { in vs_output()
426 (void)gp->scr_move(sp, in vs_output()
427 LASTLINE(sp) - 1, 0); in vs_output()
428 (void)gp->scr_clrtoeol(sp); in vs_output()
431 ++vip->totalcount; in vs_output()
432 ++vip->linecount; in vs_output()
434 if (vip->totalcount == sp->t_maxrows && in vs_output()
436 --vip->totalcount; in vs_output()
437 --vip->linecount; in vs_output()
441 if (vip->totalcount != 0) in vs_output()
444 (void)gp->scr_move(sp, LASTLINE(sp), 0); in vs_output()
445 ++vip->totalcount; in vs_output()
446 ++vip->linecount; in vs_output()
451 (void)gp->scr_move(sp, LASTLINE(sp), vip->lcontinue); in vs_output()
455 (void)gp->scr_attr(sp, SA_INVERSE, 1); in vs_output()
457 /* Display the line, doing character translation. */ in vs_output()
460 (void)gp->scr_addstr(sp, cbuf, cbp - cbuf); \ in vs_output()
463 ecbp = (cbp = cbuf) + sizeof(cbuf) - 1; in vs_output()
464 for (t = line, tlen = len; tlen--; ++t) { in vs_output()
468 * at <tabs> -- and all routines that care about in vs_output()
479 (void)gp->scr_attr(sp, SA_INVERSE, 0); in vs_output()
482 (void)gp->scr_clrtoeol(sp); in vs_output()
485 vip->lcontinue = 0; in vs_output()
489 llen -= len; in vs_output()
492 --llen; in vs_output()
498 gp->scr_cursor(sp, ¬used, &vip->lcontinue); in vs_output()
502 * vs_ex_resolve --
518 gp = sp->gp; in vs_ex_resolve()
526 if (vip->lcontinue != 0) { in vs_ex_resolve()
527 vs_output(sp, vip->mtype, ".", 1); in vs_ex_resolve()
528 vip->lcontinue = 0; in vs_ex_resolve()
530 vip->mtype = M_NONE; in vs_ex_resolve()
545 * we display cumulative line modification reports for groups of ex in vs_ex_resolve()
549 if (sp->gp->scr_screen(sp, SC_VI)) in vs_ex_resolve()
552 if (!F_ISSET(sp, SC_EX_WAIT_YES) && vip->totalcount < 2) { in vs_ex_resolve()
592 (void)gp->scr_attr(sp, SA_ALTERNATE, 1); in vs_ex_resolve()
609 if (vip->totalcount > 1) { in vs_ex_resolve()
612 ev.e_flno = vip->totalcount >= in vs_ex_resolve()
613 sp->rows ? 1 : sp->rows - vip->totalcount; in vs_ex_resolve()
614 ev.e_tlno = sp->rows; in vs_ex_resolve()
617 vip->linecount = vip->lcontinue = vip->totalcount = 0; in vs_ex_resolve()
623 vip->linecount = vip->lcontinue = vip->totalcount = 0; in vs_ex_resolve()
629 * vs_resolve --
651 gp = sp->gp; in vs_resolve()
657 (void)gp->scr_cursor(csp, &oldy, &oldx); in vs_resolve()
662 (void)gp->scr_bell(sp); in vs_resolve()
665 /* Display new file status line. */ in vs_resolve()
668 msgq_status(sp, sp->lno, MSTAT_TRUNCATE); in vs_resolve()
676 * it. (A side-effect of screen refresh is that we can display in vs_resolve()
680 if (!SLIST_EMPTY(gp->msgq)) { in vs_resolve()
683 while ((mp = SLIST_FIRST(gp->msgq)) != NULL) { in vs_resolve()
684 gp->scr_msg(sp, mp->mtype, mp->buf, mp->len); in vs_resolve()
685 SLIST_REMOVE_HEAD(gp->msgq, q); in vs_resolve()
686 free(mp->buf); in vs_resolve()
692 switch (vip->totalcount) { in vs_resolve()
716 ev.e_flno = vip->totalcount >= in vs_resolve()
717 sp->rows ? 1 : sp->rows - vip->totalcount; in vs_resolve()
718 ev.e_tlno = sp->rows; in vs_resolve()
725 vip->linecount = vip->lcontinue = vip->totalcount = 0; in vs_resolve()
732 (void)gp->scr_move(csp, oldy, oldx); in vs_resolve()
738 * vs_scroll --
747 gp = sp->gp; in vs_scroll()
755 (void)gp->scr_move(sp, vip->totalcount < in vs_scroll()
756 sp->rows ? LASTLINE(sp) - vip->totalcount : 0, 0); in vs_scroll()
757 (void)gp->scr_deleteln(sp); in vs_scroll()
761 (void)gp->scr_move(sp, LASTLINE(sp), 0); in vs_scroll()
762 (void)gp->scr_insertln(sp); in vs_scroll()
765 if (wtype == SCROLL_W_QUIT && vip->linecount < sp->t_maxrows) in vs_scroll()
771 * vs_wait --
783 gp = sp->gp; in vs_wait()
786 (void)gp->scr_move(sp, LASTLINE(sp), 0); in vs_wait()
804 (void)gp->scr_addstr(sp, p, len); in vs_wait()
806 ++vip->totalcount; in vs_wait()
807 vip->linecount = 0; in vs_wait()
809 (void)gp->scr_clrtoeol(sp); in vs_wait()
810 (void)gp->scr_refresh(sp, 0); in vs_wait()
825 (void)gp->scr_bell(sp); in vs_wait()
842 * vs_divider --
853 sizeof(DIVIDESTR) - 1 > sp->cols ? sp->cols : sizeof(DIVIDESTR) - 1; in vs_divider()
854 gp = sp->gp; in vs_divider()
855 (void)gp->scr_attr(sp, SA_INVERSE, 1); in vs_divider()
856 (void)gp->scr_addstr(sp, DIVIDESTR, len); in vs_divider()
857 (void)gp->scr_attr(sp, SA_INVERSE, 0); in vs_divider()
861 * vs_msgsave --
862 * Save a message for later display.
878 MALLOC_GOTO(sp, mp_n->buf, len); in vs_msgsave()
880 memmove(mp_n->buf, p, len); in vs_msgsave()
881 mp_n->len = len; in vs_msgsave()
882 mp_n->mtype = mt; in vs_msgsave()
884 gp = sp->gp; in vs_msgsave()
885 if (SLIST_EMPTY(gp->msgq)) { in vs_msgsave()
886 SLIST_INSERT_HEAD(gp->msgq, mp_n, q); in vs_msgsave()
888 SLIST_FOREACH(mp_c, gp->msgq, q) in vs_msgsave()