Lines Matching +full:smp +full:- +full:offset

1 /*-
34 * v_repaint --
44 SMAP *smp; in vs_repaint() local
46 for (; evp->e_flno <= evp->e_tlno; ++evp->e_flno) { in vs_repaint()
47 smp = HMAP + evp->e_flno - 1; in vs_repaint()
48 SMAP_FLUSH(smp); in vs_repaint()
49 if (vs_line(sp, smp, NULL, NULL)) in vs_repaint()
56 * vs_refresh --
71 gp = sp->gp; in vs_refresh()
80 TAILQ_FOREACH(tsp, gp->dq, q) in vs_refresh()
97 TAILQ_FOREACH(tsp, gp->dq, q) in vs_refresh()
111 * Also, always do it last -- that way, SC_SCR_REDRAW can be set in vs_refresh()
132 TAILQ_FOREACH(tsp, gp->dq, q) in vs_refresh()
138 (void)gp->scr_refresh(sp, 0); in vs_refresh()
141 * A side-effect of refreshing the screen is that it's now ready in vs_refresh()
149 * vs_paint --
164 SMAP *smp, tmp; in vs_paint() local
171 #define LNO sp->lno /* Current file line. */ in vs_paint()
172 #define OLNO vip->olno /* Remembered file line. */ in vs_paint()
173 #define CNO sp->cno /* Current file column. */ in vs_paint()
174 #define OCNO vip->ocno /* Remembered file column. */ in vs_paint()
175 #define SCNO vip->sc_col /* Current screen column. */ in vs_paint()
177 gp = sp->gp; in vs_paint()
241 * screen but the column offset is not, we'll end up in the adjust in vs_paint()
245 if (LNO < HMAP->lno) { in vs_paint()
246 lcnt = vs_sm_nlines(sp, HMAP, LNO, sp->t_maxrows); in vs_paint()
248 for (; lcnt && sp->t_rows != sp->t_maxrows; in vs_paint()
249 --lcnt, ++sp->t_rows) { in vs_paint()
256 } else if (LNO > TMAP->lno) { in vs_paint()
257 lcnt = vs_sm_nlines(sp, TMAP, LNO, sp->t_maxrows); in vs_paint()
259 for (; lcnt && sp->t_rows != sp->t_maxrows; in vs_paint()
260 --lcnt, ++sp->t_rows) { in vs_paint()
268 small_fill: (void)gp->scr_move(sp, LASTLINE(sp), 0); in vs_paint()
269 (void)gp->scr_clrtoeol(sp); in vs_paint()
270 for (; sp->t_rows > sp->t_minrows; in vs_paint()
271 --sp->t_rows, --TMAP) { in vs_paint()
272 (void)gp->scr_move(sp, TMAP - HMAP, 0); in vs_paint()
273 (void)gp->scr_clrtoeol(sp); in vs_paint()
286 if (LNO >= HMAP->lno) { in vs_paint()
288 if (LNO <= TMAP->lno) in vs_paint()
301 while (lcnt--) in vs_paint()
327 if (db_exist(sp, HMAP->lno)) { in vs_paint()
328 while (lcnt--) in vs_paint()
342 tmp.coff = HMAP->coff; in vs_paint()
344 lcnt = vs_sm_nlines(sp, &tmp, lastline, sp->t_rows); in vs_paint()
361 tmp.coff = HMAP->coff; in vs_paint()
384 * left-right scrolling, the cursor movement code handles the problem. in vs_paint()
392 (LNO == HMAP->lno || LNO == TMAP->lno)) { in vs_paint()
394 if (LNO == HMAP->lno && cnt < HMAP->soff) { in vs_paint()
395 if ((HMAP->soff - cnt) > HALFTEXT(sp)) { in vs_paint()
396 HMAP->soff = cnt; in vs_paint()
400 while (cnt < HMAP->soff) in vs_paint()
404 if (LNO == TMAP->lno && cnt > TMAP->soff) { in vs_paint()
405 if ((cnt - TMAP->soff) > HALFTEXT(sp)) { in vs_paint()
406 TMAP->soff = cnt; in vs_paint()
410 while (cnt > TMAP->soff) in vs_paint()
437 * line. Otherwise, we've just moved over fixed-width characters, in vs_paint()
491 cnt = (OCNO - CNO) + 1; in vs_paint()
496 * Quick sanity check -- it's hard to figure out exactly when in vs_paint()
508 for (cwtotal = 0; cnt--; cwtotal += KEY_COL(sp, ch)) in vs_paint()
509 if ((ch = *(UCHAR_T *)p--) == '\t') in vs_paint()
516 cwtotal -= 1; in vs_paint()
523 cwtotal -= KEY_COL(sp, ch) - 1; in vs_paint()
532 SCNO -= cwtotal; in vs_paint()
540 cnt = CNO - OCNO; in vs_paint()
547 for (cwtotal = SCNO; cnt--;) { in vs_paint()
570 fast: (void)gp->scr_cursor(sp, &y, &notused); in vs_paint()
578 slow: for (smp = HMAP; smp->lno != LNO; ++smp); in vs_paint()
583 * If doing left-right scrolling and the cursor movement has changed in vs_paint()
586 * We adjust the offset up or down until we have a window that covers in vs_paint()
593 * for the number option offset. in vs_paint()
597 cnt -= O_NUMBER_LENGTH; in vs_paint()
600 off = smp->coff; in vs_paint()
604 off -= O_VAL(sp, O_SIDESCROLL); in vs_paint()
615 (off != 0 && off + sp->cols < cnt)) { in vs_paint()
618 } while (off + sp->cols < cnt); in vs_paint()
620 shifted: /* Fill in screen map with the new offset. */ in vs_paint()
622 smp->coff = off; in vs_paint()
624 for (smp = HMAP; smp <= TMAP; ++smp) in vs_paint()
625 smp->coff = off; in vs_paint()
643 for (y = -1, in vs_paint()
644 vip->sc_smap = NULL; smp <= TMAP && smp->lno == LNO; ++smp) { in vs_paint()
645 if (vs_line(sp, smp, &y, &SCNO)) in vs_paint()
647 if (y != -1) { in vs_paint()
648 vip->sc_smap = smp; in vs_paint()
662 paint: for (smp = HMAP; smp <= TMAP; ++smp) in vs_paint()
663 SMAP_FLUSH(smp); in vs_paint()
664 for (y = -1, vip->sc_smap = NULL, smp = HMAP; smp <= TMAP; ++smp) { in vs_paint()
665 if (vs_line(sp, smp, &y, &SCNO)) in vs_paint()
667 if (y != -1 && vip->sc_smap == NULL) in vs_paint()
668 vip->sc_smap = smp; in vs_paint()
675 for (cnt = sp->t_rows; cnt <= sp->t_maxrows; ++cnt) { in vs_paint()
676 (void)gp->scr_move(sp, cnt, 0); in vs_paint()
677 (void)gp->scr_clrtoeol(sp); in vs_paint()
689 if (vip->sc_smap == NULL) in vs_paint()
692 if (vip->sc_smap == NULL) { in vs_paint()
728 (void)gp->scr_move(sp, y, SCNO); in vs_paint()
739 (void)vs_column(sp, &sp->rcm); in vs_paint()
743 (void)gp->scr_refresh(sp, F_ISSET(vip, VIP_N_EX_PAINT)); in vs_paint()
760 * vs_modeline --
779 gp = sp->gp; in vs_modeline()
794 (void)gp->scr_move(sp, LASTLINE(sp), 0); in vs_modeline()
802 CHAR2INT(sp, sp->frp->name, strlen(sp->frp->name) + 1, wp, l); in vs_modeline()
804 for (ellipsis = 0, cols = sp->cols / 2; --p > wp;) { in vs_modeline()
815 curlen -= KEY_COL(sp, *p); in vs_modeline()
821 while (ellipsis--) in vs_modeline()
822 (void)gp->scr_addstr(sp, in vs_modeline()
824 (void)gp->scr_addstr(sp, in vs_modeline()
828 (void)gp->scr_addstr(sp, in vs_modeline()
833 (void)gp->scr_clrtoeol(sp); in vs_modeline()
840 * a zero-based number. in vs_modeline()
846 cols = sp->cols - 1; in vs_modeline()
850 (u_long)sp->lno, (u_long)(curcol + 1)); in vs_modeline()
852 midpoint = (cols - ((len + 1) / 2)) / 2; in vs_modeline()
854 (void)gp->scr_move(sp, LASTLINE(sp), midpoint); in vs_modeline()
857 (void)gp->scr_addstr(sp, " ", 2); in vs_modeline()
860 (void)gp->scr_addstr(sp, buf, len); in vs_modeline()
871 if (F_ISSET(sp->ep, F_MODIFIED)) in vs_modeline()
872 --endpoint; in vs_modeline()
873 t = msg_cat(sp, modes[sp->showmode], &len); in vs_modeline()
874 endpoint -= len; in vs_modeline()
878 (void)gp->scr_move(sp, LASTLINE(sp), endpoint); in vs_modeline()
880 if (F_ISSET(sp->ep, F_MODIFIED)) in vs_modeline()
881 (void)gp->scr_addstr(sp, in vs_modeline()
883 (void)gp->scr_addstr(sp, t, len); in vs_modeline()