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

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