Lines Matching +full:display +full:- +full:rows

1 /*-
33 * vs_split --
42 int ccl) /* Colon-command line split. */ in vs_split()
49 gp = sp->gp; in vs_split()
53 if (sp->rows < 4) { in vs_split()
55 "222|Screen must be larger than %d lines to split", 4 - 1); in vs_split()
66 _HMAP(new)->lno = sp->lno; in vs_split()
67 _HMAP(new)->coff = 0; in vs_split()
68 _HMAP(new)->soff = 1; in vs_split()
71 half = sp->rows / 2; in vs_split()
82 new->coff = sp->coff; in vs_split()
83 new->cols = sp->cols; in vs_split()
91 * Recalculate current cursor position based on sp->lno, we're called in vs_split()
96 !ccl && (vs_sm_cursor(sp, &smp) ? 0 : (smp - HMAP) + 1) >= half; in vs_split()
98 new->rows = sp->rows - half; /* New. */ in vs_split()
99 new->roff = sp->roff; in vs_split()
100 sp->rows = half; /* Old. */ in vs_split()
101 sp->roff += new->rows; in vs_split()
105 * the map down to match on-screen text. in vs_split()
107 memcpy(_HMAP(sp), _HMAP(sp) + new->rows, in vs_split()
108 (sp->t_maxrows - new->rows) * sizeof(SMAP)); in vs_split()
110 new->rows = half; /* New. */ in vs_split()
111 sp->rows -= half; /* Old. */ in vs_split()
112 new->roff = sp->roff + sp->rows; in vs_split()
116 sp->t_maxrows = IS_ONELINE(sp) ? 1 : sp->rows - 1; in vs_split()
117 new->t_maxrows = IS_ONELINE(new) ? 1 : new->rows - 1; in vs_split()
129 sp->t_rows -= new->rows; in vs_split()
132 if (sp->t_rows > sp->t_maxrows) in vs_split()
133 sp->t_rows = sp->t_maxrows; in vs_split()
134 if (sp->t_minrows > sp->t_maxrows) in vs_split()
135 sp->t_minrows = sp->t_maxrows; in vs_split()
138 new->t_minrows = new->t_rows = O_VAL(sp, O_WINDOW); in vs_split()
139 if (new->t_rows > new->t_maxrows) in vs_split()
140 new->t_rows = new->t_maxrows; in vs_split()
141 if (new->t_minrows > new->t_maxrows) in vs_split()
142 new->t_minrows = new->t_maxrows; in vs_split()
144 sp->t_minrows = sp->t_rows = IS_ONELINE(sp) ? 1 : sp->rows - 1; in vs_split()
152 new->t_minrows = new->t_rows = O_VAL(sp, O_WINDOW); in vs_split()
153 if (new->t_rows > new->rows - 1) in vs_split()
154 new->t_minrows = new->t_rows = in vs_split()
155 IS_ONELINE(new) ? 1 : new->rows - 1; in vs_split()
160 _HMAP(sp) : _HMAP(sp) + (sp->t_rows - 1); in vs_split()
162 _HMAP(new) : _HMAP(new) + (new->t_rows - 1); in vs_split()
165 if ((sp->defscroll = sp->t_maxrows / 2) == 0) in vs_split()
166 sp->defscroll = 1; in vs_split()
167 if ((new->defscroll = new->t_maxrows / 2) == 0) in vs_split()
168 new->defscroll = 1; in vs_split()
171 vs_insert(new, sp->gp); in vs_split()
173 /* Tell the display that we're splitting. */ in vs_split()
174 (void)gp->scr_split(sp, new); in vs_split()
184 * call vs_resolve to display the status message in vs_split()
198 * vs_vsplit --
209 gp = sp->gp; in vs_vsplit()
212 if (sp->cols / 2 <= MINIMUM_SCREEN_COLS) { in vs_vsplit()
226 _HMAP(new)->lno = sp->lno; in vs_vsplit()
227 _HMAP(new)->coff = 0; in vs_vsplit()
228 _HMAP(new)->soff = 1; in vs_vsplit()
241 * one. This should be worked out with the display interface. in vs_vsplit()
243 cols = sp->cols / 2; in vs_vsplit()
244 new->cols = sp->cols - cols - 1; in vs_vsplit()
245 sp->cols = cols; in vs_vsplit()
246 new->coff = sp->coff + cols + 1; in vs_vsplit()
247 sp->cno = 0; in vs_vsplit()
250 new->rows = sp->rows; in vs_vsplit()
251 new->t_rows = sp->t_rows; in vs_vsplit()
252 new->t_maxrows = sp->t_maxrows; in vs_vsplit()
253 new->t_minrows = sp->t_minrows; in vs_vsplit()
254 new->roff = sp->roff; in vs_vsplit()
255 new->defscroll = sp->defscroll; in vs_vsplit()
256 _TMAP(new) = _HMAP(new) + (new->t_rows - 1); in vs_vsplit()
259 vs_insert(new, sp->gp); in vs_vsplit()
261 /* Tell the display that we're splitting. */ in vs_vsplit()
262 (void)gp->scr_split(sp, new); in vs_vsplit()
275 * call vs_resolve to display the status message in vs_vsplit()
289 * vs_insert --
298 gp = sp->gp; in vs_insert()
301 TAILQ_FOREACH(tsp, gp->dq, q) in vs_insert()
302 if (tsp->roff >= sp->roff) in vs_insert()
309 if (tsp->roff != sp->roff || tsp->coff > sp->coff) in vs_insert()
317 TAILQ_INSERT_TAIL(gp->dq, sp, q); in vs_insert()
318 } else if (tsp->roff < sp->roff || in vs_insert()
319 (tsp->roff == sp->roff && tsp->coff < sp->coff)) { in vs_insert()
320 TAILQ_INSERT_AFTER(gp->dq, tsp, sp, q); in vs_insert()
326 * vs_discard --
327 * Discard the screen, folding the real-estate into a related screen,
339 gp = sp->gp; in vs_discard()
348 if (sp->frp != NULL) { in vs_discard()
349 sp->frp->lno = sp->lno; in vs_discard()
350 sp->frp->cno = sp->cno; in vs_discard()
351 F_SET(sp->frp, FR_CURSORSET); in vs_discard()
356 (void)gp->scr_discard(sp, NULL); in vs_discard()
396 tsp->rows += sp->rows; in vs_discard()
398 tsp->t_rows = tsp->t_minrows = tsp->rows - 1; in vs_discard()
399 tsp->t_maxrows = tsp->rows - 1; in vs_discard()
401 tsp->defscroll = tsp->t_maxrows / 2; in vs_discard()
403 *(_HMAP(tsp) + (tsp->t_rows - 1)) = *_TMAP(tsp); in vs_discard()
404 _TMAP(tsp) = _HMAP(tsp) + (tsp->t_rows - 1); in vs_discard()
408 tsp->roff = sp->roff; in vs_discard()
424 tsp->coff = sp->coff; in vs_discard()
425 tsp->cols += sp->cols + 1; /* XXX: DIVIDER */ in vs_discard()
439 /* Tell the display that we're discarding a screen. */ in vs_discard()
440 (void)gp->scr_discard(sp, list); in vs_discard()
446 * vs_join --
457 gp = sp->gp; in vs_join()
460 for (lp = listp, tlen = sp->rows, in vs_join()
461 tsp = TAILQ_FIRST(gp->dq); in vs_join()
466 if (tsp->coff + tsp->cols + 1 != sp->coff) in vs_join()
472 if (tsp->roff > sp->roff + sp->rows) in vs_join()
474 if (tsp->roff < sp->roff) { in vs_join()
475 if (tsp->roff + tsp->rows >= sp->roff) in vs_join()
479 if (tsp->roff + tsp->rows > sp->roff + sp->rows) in vs_join()
482 if (tlen < tsp->rows) in vs_join()
485 tlen -= tsp->rows; in vs_join()
495 for (lp = listp, tlen = sp->rows, in vs_join()
496 tsp = TAILQ_FIRST(gp->dq); in vs_join()
501 if (tsp->coff != sp->coff + sp->cols + 1) in vs_join()
507 if (tsp->roff > sp->roff + sp->rows) in vs_join()
509 if (tsp->roff < sp->roff) { in vs_join()
510 if (tsp->roff + tsp->rows >= sp->roff) in vs_join()
514 if (tsp->roff + tsp->rows > sp->roff + sp->rows) in vs_join()
517 if (tlen < tsp->rows) in vs_join()
520 tlen -= tsp->rows; in vs_join()
530 for (first = 0, lp = listp, tlen = sp->cols, in vs_join()
531 tsp = TAILQ_FIRST(gp->dq); in vs_join()
536 if (tsp->roff + tsp->rows != sp->roff) in vs_join()
542 if (tsp->coff > sp->coff + sp->cols) in vs_join()
544 if (tsp->coff < sp->coff) { in vs_join()
545 if (tsp->coff + tsp->cols >= sp->coff) in vs_join()
549 if (tsp->coff + tsp->cols > sp->coff + sp->cols) in vs_join()
552 if (tlen < tsp->cols) in vs_join()
555 tlen -= tsp->cols + first; in vs_join()
566 for (first = 0, lp = listp, tlen = sp->cols, in vs_join()
567 tsp = TAILQ_FIRST(gp->dq); in vs_join()
572 if (tsp->roff != sp->roff + sp->rows) in vs_join()
578 if (tsp->coff > sp->coff + sp->cols) in vs_join()
580 if (tsp->coff < sp->coff) { in vs_join()
581 if (tsp->coff + tsp->cols >= sp->coff) in vs_join()
585 if (tsp->coff + tsp->cols > sp->coff + sp->cols) in vs_join()
588 if (tlen < tsp->cols) in vs_join()
591 tlen -= tsp->cols + first; in vs_join()
604 * vs_fg --
617 gp = sp->gp; in vs_fg()
641 TAILQ_REMOVE(gp->hq, nsp, q); in vs_fg()
645 TAILQ_INSERT_TAIL(gp->hq, nsp, q); in vs_fg()
650 TAILQ_REMOVE(gp->dq, sp, q); in vs_fg()
651 TAILQ_INSERT_TAIL(gp->hq, sp, q); in vs_fg()
657 * vs_bg --
668 gp = sp->gp; in vs_bg()
680 TAILQ_REMOVE(gp->dq, sp, q); in vs_bg()
681 TAILQ_INSERT_TAIL(gp->hq, sp, q); in vs_bg()
688 sp->nextdisp = nsp; in vs_bg()
695 * vs_swap --
706 gp = sp->gp; in vs_swap()
719 if (sp->frp != NULL) { in vs_swap()
720 sp->frp->lno = sp->lno; in vs_swap()
721 sp->frp->cno = sp->cno; in vs_swap()
722 F_SET(sp->frp, FR_CURSORSET); in vs_swap()
726 sp->nextdisp = nsp; in vs_swap()
730 VIP(nsp)->srows = VIP(sp)->srows; in vs_swap()
733 nsp->cols = sp->cols; in vs_swap()
734 nsp->rows = sp->rows; /* XXX: Only place in vi that sets rows. */ in vs_swap()
735 nsp->roff = sp->roff; in vs_swap()
745 nsp->t_minrows = nsp->t_rows = O_VAL(nsp, O_WINDOW); in vs_swap()
746 if (nsp->t_rows > sp->t_maxrows) in vs_swap()
747 nsp->t_rows = nsp->t_maxrows; in vs_swap()
748 if (nsp->t_minrows > sp->t_maxrows) in vs_swap()
749 nsp->t_minrows = nsp->t_maxrows; in vs_swap()
751 nsp->t_rows = nsp->t_maxrows = nsp->t_minrows = nsp->rows - 1; in vs_swap()
754 nsp->defscroll = nsp->t_maxrows / 2; in vs_swap()
758 _TMAP(nsp) = _HMAP(nsp) + (nsp->t_rows - 1); in vs_swap()
761 nsp->gp = sp->gp; in vs_swap()
762 if (vs_sm_fill(nsp, nsp->lno, P_FILL)) in vs_swap()
771 TAILQ_REMOVE(gp->hq, nsp, q); in vs_swap()
772 TAILQ_INSERT_AFTER(gp->dq, sp, nsp, q); in vs_swap()
784 (void)gp->scr_discard(sp, list); in vs_swap()
790 * vs_resize --
802 gp = sp->gp; in vs_resize()
811 if (sp->t_maxrows == count) in vs_resize()
813 if (sp->t_maxrows > count) { in vs_resize()
815 count = sp->t_maxrows - count; in vs_resize()
818 count = count - sp->t_maxrows; in vs_resize()
824 (next->coff >= sp->coff + sp->cols || in vs_resize()
825 next->coff + next->cols <= sp->coff); in vs_resize()
829 (sp->coff != next->coff || sp->cols != next->cols)) in vs_resize()
832 (prev->coff >= sp->coff + sp->cols || in vs_resize()
833 prev->coff + prev->cols <= sp->coff); in vs_resize()
836 (sp->coff != prev->coff || sp->cols != prev->cols)) in vs_resize()
842 count = -count; in vs_resize()
844 if (s->t_maxrows < MINIMUM_SCREEN_ROWS + count) in vs_resize()
849 g_off = -count; in vs_resize()
855 s->t_maxrows >= MINIMUM_SCREEN_ROWS + count) in vs_resize()
866 if (s->t_maxrows < MINIMUM_SCREEN_ROWS + count) { in vs_resize()
868 "226|The screen can only shrink to %d rows", in vs_resize()
872 g_off = -count; in vs_resize()
881 s->rows += -count; in vs_resize()
882 s->roff += s_off; in vs_resize()
883 g->rows += count; in vs_resize()
884 g->roff += g_off; in vs_resize()
886 g->t_rows += count; in vs_resize()
887 if (g->t_minrows == g->t_maxrows) in vs_resize()
888 g->t_minrows += count; in vs_resize()
889 g->t_maxrows += count; in vs_resize()
893 s->t_rows -= count; in vs_resize()
894 s->t_maxrows -= count; in vs_resize()
895 if (s->t_minrows > s->t_maxrows) in vs_resize()
896 s->t_minrows = s->t_maxrows; in vs_resize()
897 _TMAP(s) -= count; in vs_resize()
902 gp->scr_discard(0, list); in vs_resize()
908 * vs_getbg --
919 gp = sp->gp; in vs_getbg()
923 return (TAILQ_FIRST(gp->hq)); in vs_getbg()
926 TAILQ_FOREACH(nsp, gp->hq, q) in vs_getbg()
927 if (!strcmp(nsp->frp->name, name)) in vs_getbg()
932 /* Search for a last-component match. */ in vs_getbg()
933 TAILQ_FOREACH(nsp, gp->hq, q) { in vs_getbg()
934 if ((p = strrchr(nsp->frp->name, '/')) == NULL) in vs_getbg()
935 p = nsp->frp->name; in vs_getbg()