1 /* $OpenBSD: display.c,v 1.37 2009/06/04 02:23:37 kjell Exp $ */
3 /* This file is in the public domain. */
6 * The functions in this file handle redisplay. The
7 * redisplay system knows almost nothing about the editing
8 * process; the editing functions do, however, set some
9 * hints to eliminate a lot of the grinding. There is more
10 * that can be done; the "vtputc" interface is a real
19 * You can change these back to the types
20 * implied by the name if you get tight for space. If you
21 * make both of them "int" you get better code on the VAX.
22 * They do nothing if this is not Gosling redisplay, except
23 * for change the size of a structure that isn't used.
29 #ifdef STANDOUT_GLITCH
34 * A video structure always holds
35 * an array of characters whose length is equal to
36 * the longest line possible. v_text is allocated
37 * dynamically to fit the screen width.
40 short v_hash; /* Hash code, for compares. */
41 short v_flag; /* Flag word. */
42 short v_color; /* Color of the line. */
43 XSHORT v_cost; /* Cost of display. */
44 char *v_text; /* The actual characters. */
47 #define VFCHG 0x0001 /* Changed. */
48 #define VFHBAD 0x0002 /* Hash and cost are bad. */
49 #define VFEXT 0x0004 /* extended line (beond ncol) */
52 * SCORE structures hold the optimal
53 * trace trajectory, and the cost of redisplay, when
54 * the dynamic programming redisplay code is used.
55 * If no fancy redisplay, this isn't used. The trace index
56 * fields can be "char", and the cost a "short", but
57 * this makes the code worse on the VAX.
60 XCHAR s_itrace; /* "i" index for track back. */
61 XCHAR s_jtrace; /* "j" index for trace back. */
62 XSHORT s_cost; /* Display cost. */
65 void vtmove(int, int);
68 int vtputs(const char *);
70 void updext(int, int);
71 void modeline(struct mgwin *);
72 void setscores(int, int);
73 void traceback(int, int, int, int);
74 void ucopy(struct video *, struct video *);
75 void uline(int, struct video *, struct video *);
76 void hash(struct video *);
79 int sgarbf = TRUE; /* TRUE if screen is garbage. */
80 int vtrow = HUGE; /* Virtual cursor row. */
81 int vtcol = HUGE; /* Virtual cursor column. */
82 int tthue = CNONE; /* Current color. */
83 int ttrow = HUGE; /* Physical cursor row. */
84 int ttcol = HUGE; /* Physical cursor column. */
85 int tttop = HUGE; /* Top of scroll region. */
86 int ttbot = HUGE; /* Bottom of scroll region. */
87 int lbound = 0; /* leftmost bound of the current */
88 /* line being displayed */
90 struct video **vscreen; /* Edge vector, virtual. */
91 struct video **pscreen; /* Edge vector, physical. */
92 struct video *video; /* Actual screen data. */
93 struct video blanks; /* Blank line image. */
96 * This matrix is written as an array because
97 * we do funny things in the "setscores" routine, which
98 * is very compute intensive, to make the subscripts go away.
99 * It would be "SCORE score[NROW][NROW]" in old speak.
100 * Look at "setscores" to understand what is up.
102 struct score *score; /* [NROW * NROW] */
105 #define LINENOMODE TRUE
106 #endif /* !LINENOMODE */
107 static int linenos = LINENOMODE;
109 /* Is macro recording enabled? */
111 /* Is working directory global? */
115 * Since we don't have variables (we probably should) these are command
116 * processors for changing the values of mode flags.
120 linenotoggle(int f, int n)
133 * Reinit the display data structures, this is called when the terminal
137 vtresize(int force, int newrow, int newcol)
140 int rowchanged, colchanged;
141 static int first_run = 1;
144 if (newrow < 1 || newcol < 1)
147 rowchanged = (newrow != nrow);
148 colchanged = (newcol != ncol);
150 #define TRYREALLOC(a, n) do { \
152 if ((tmp = realloc((a), (n))) == NULL) { \
153 panic("out of memory in display code"); \
158 /* No update needed */
159 if (!first_run && !force && !rowchanged && !colchanged)
163 memset(&blanks, 0, sizeof(blanks));
165 if (rowchanged || first_run) {
169 * This is not pretty.
174 vidstart = 2 * (nrow - 1);
177 * We're shrinking, free some internal data.
180 for (i = 2 * (newrow - 1); i < 2 * (nrow - 1); i++) {
181 free(video[i].v_text);
182 video[i].v_text = NULL;
186 TRYREALLOC(score, newrow * newrow * sizeof(struct score));
187 TRYREALLOC(vscreen, (newrow - 1) * sizeof(struct video *));
188 TRYREALLOC(pscreen, (newrow - 1) * sizeof(struct video *));
189 TRYREALLOC(video, (2 * (newrow - 1)) * sizeof(struct video));
192 * Zero-out the entries we just allocated.
194 for (i = vidstart; i < 2 * (newrow - 1); i++)
195 memset(&video[i], 0, sizeof(struct video));
198 * Reinitialize vscreen and pscreen arrays completely.
201 for (i = 0; i < newrow - 1; ++i) {
208 if (rowchanged || colchanged || first_run) {
209 for (i = 0; i < 2 * (newrow - 1); i++)
210 TRYREALLOC(video[i].v_text, newcol * sizeof(char));
211 TRYREALLOC(blanks.v_text, newcol * sizeof(char));
229 * Initialize the data structures used
230 * by the display code. The edge vectors used
231 * to access the screens are set up. The operating
232 * system's terminal I/O channel is set up. Fill the
233 * "blanks" array with ASCII blanks. The rest is done
234 * at compile time. The original window is marked
235 * as needing full update, and the physical screen
236 * is marked as garbage, so all the right stuff happens
237 * on the first call to redisplay.
248 * ttinit called ttresize(), which called vtresize(), so our data
249 * structures are setup correctly.
252 blanks.v_color = CTEXT;
253 for (i = 0; i < ncol; ++i)
254 blanks.v_text[i] = ' ';
258 * Tidy up the virtual display system
259 * in anticipation of a return back to the host
260 * operating system. Right now all we do is position
261 * the cursor to the last line, erase the line, and
262 * close the terminal channel.
268 ttnowindow(); /* No scroll window. */
269 ttmove(nrow - 1, 0); /* Echo line. */
277 * Move the virtual cursor to an origin
278 * 0 spot on the virtual display screen. I could
279 * store the column as a character pointer to the spot
280 * on the line, which would make "vtputc" a little bit
281 * more efficient. No checking for errors.
284 vtmove(int row, int col)
291 * Write a character to the virtual display,
292 * dealing with long lines and the display of unprintable
293 * things like control characters. Also expand tabs every 8
294 * columns. This code only puts printing characters into
295 * the virtual display image. Special care must be taken when
296 * expanding tabs. On a screen whose width is not a multiple
297 * of 8, it is possible for the virtual cursor to hit the
298 * right margin before the next tab stop is reached. This
299 * makes the tab code loop if you are not careful.
300 * Three guesses how we found this.
311 vp->v_text[ncol - 1] = '$';
314 && !(curbp->b_flag & BFNOTAB)
319 } while (vtcol < ncol && (vtcol & 0x07) != 0);
320 } else if (ISCTRL(c)) {
323 } else if (isprint(c))
324 vp->v_text[vtcol++] = c;
328 snprintf(bf, sizeof(bf), "\\%o", c);
334 * Put a character to the virtual screen in an extended line. If we are not
335 * yet on left edge, don't print it yet. Check for overflow on the right
347 vp->v_text[ncol - 1] = '$';
350 && !(curbp->b_flag & BFNOTAB)
355 } while (((vtcol + lbound) & 0x07) != 0 && vtcol < ncol);
356 } else if (ISCTRL(c) != FALSE) {
361 vp->v_text[vtcol] = c;
367 * Erase from the end of the software cursor to the end of the line on which
368 * the software cursor is located. The display routines will decide if a
369 * hardware erase to end of line command should be used to display this.
378 vp->v_text[vtcol++] = ' ';
382 * Make sure that the display is
383 * right. This is a three part process. First,
384 * scan through all of the windows looking for dirty
385 * ones. Check the framing, and refresh the screen.
386 * Second, make sure that "currow" and "curcol" are
387 * correct for the current window. Third, make the
388 * virtual and physical screens the same.
404 if (sgarbf) { /* must update everything */
407 wp->w_rflag |= WFMODE | WFFULL;
414 wp->w_rflag |= WFMODE;
418 hflag = FALSE; /* Not hard. */
419 for (wp = wheadp; wp != NULL; wp = wp->w_wndp) {
421 * Nothing to be done.
423 if (wp->w_rflag == 0)
426 if ((wp->w_rflag & WFFRAME) == 0) {
428 for (i = 0; i < wp->w_ntrows; ++i) {
429 if (lp == wp->w_dotp)
431 if (lp == wp->w_bufp->b_headp)
437 * Put the middle-line in place.
442 if (i >= wp->w_ntrows)
443 i = wp->w_ntrows - 1;
449 i = wp->w_ntrows / 2; /* current center, no change */
455 while (i != 0 && lback(lp) != wp->w_bufp->b_headp) {
460 wp->w_rflag |= WFFULL; /* Force full. */
462 lp = wp->w_linep; /* Try reduced update. */
464 if ((wp->w_rflag & ~WFMODE) == WFEDIT) {
465 while (lp != wp->w_dotp) {
469 vscreen[i]->v_color = CTEXT;
470 vscreen[i]->v_flag |= (VFCHG | VFHBAD);
472 for (j = 0; j < llength(lp); ++j)
473 vtputc(lgetc(lp, j));
475 } else if ((wp->w_rflag & (WFEDIT | WFFULL)) != 0) {
477 while (i < wp->w_toprow + wp->w_ntrows) {
478 vscreen[i]->v_color = CTEXT;
479 vscreen[i]->v_flag |= (VFCHG | VFHBAD);
481 if (lp != wp->w_bufp->b_headp) {
482 for (j = 0; j < llength(lp); ++j)
483 vtputc(lgetc(lp, j));
490 if ((wp->w_rflag & WFMODE) != 0)
495 lp = curwp->w_linep; /* Cursor location. */
496 currow = curwp->w_toprow;
497 while (lp != curwp->w_dotp) {
503 while (i < curwp->w_doto) {
507 && !(curbp->b_flag & BFNOTAB)
512 } else if (ISCTRL(c) != FALSE)
519 snprintf(bf, sizeof(bf), "\\%o", c);
520 curcol += strlen(bf);
523 if (curcol >= ncol - 1) { /* extended line. */
524 /* flag we are extended and changed */
525 vscreen[currow]->v_flag |= VFEXT | VFCHG;
526 updext(currow, curcol); /* and output extended line */
528 lbound = 0; /* not extended line */
531 * Make sure no lines need to be de-extended because the cursor is no
538 while (i < wp->w_toprow + wp->w_ntrows) {
539 if (vscreen[i]->v_flag & VFEXT) {
540 /* always flag extended lines as changed */
541 vscreen[i]->v_flag |= VFCHG;
542 if ((wp != curwp) || (lp != wp->w_dotp) ||
543 (curcol < ncol - 1)) {
545 for (j = 0; j < llength(lp); ++j)
546 vtputc(lgetc(lp, j));
548 /* this line no longer is extended */
549 vscreen[i]->v_flag &= ~VFEXT;
555 /* if garbaged then fix up mode lines */
557 vscreen[i]->v_flag |= VFCHG;
558 /* and onward to the next window */
562 if (sgarbf != FALSE) { /* Screen is garbage. */
563 sgarbf = FALSE; /* Erase-page clears. */
564 epresf = FALSE; /* The message area. */
565 tttop = HUGE; /* Forget where you set. */
566 ttbot = HUGE; /* scroll region. */
567 tthue = CNONE; /* Color unknown. */
570 for (i = 0; i < nrow - 1; ++i) {
571 uline(i, vscreen[i], &blanks);
572 ucopy(vscreen[i], pscreen[i]);
574 ttmove(currow, curcol - lbound);
578 if (hflag != FALSE) { /* Hard update? */
579 for (i = 0; i < nrow - 1; ++i) {/* Compute hash data. */
583 offs = 0; /* Get top match. */
584 while (offs != nrow - 1) {
587 if (vp1->v_color != vp2->v_color
588 || vp1->v_hash != vp2->v_hash)
590 uline(offs, vp1, vp2);
594 if (offs == nrow - 1) { /* Might get it all. */
595 ttmove(currow, curcol - lbound);
599 size = nrow - 1; /* Get bottom match. */
600 while (size != offs) {
601 vp1 = vscreen[size - 1];
602 vp2 = pscreen[size - 1];
603 if (vp1->v_color != vp2->v_color
604 || vp1->v_hash != vp2->v_hash)
606 uline(size - 1, vp1, vp2);
610 if ((size -= offs) == 0) /* Get screen size. */
611 panic("Illegal screen size in update");
612 setscores(offs, size); /* Do hard update. */
613 traceback(offs, size, size, size);
614 for (i = 0; i < size; ++i)
615 ucopy(vscreen[offs + i], pscreen[offs + i]);
616 ttmove(currow, curcol - lbound);
620 for (i = 0; i < nrow - 1; ++i) { /* Easy update. */
623 if ((vp1->v_flag & VFCHG) != 0) {
628 ttmove(currow, curcol - lbound);
633 * Update a saved copy of a line,
634 * kept in a video structure. The "vvp" is
635 * the one in the "vscreen". The "pvp" is the one
636 * in the "pscreen". This is called to make the
637 * virtual and physical screens the same when
638 * display has done an update.
641 ucopy(struct video *vvp, struct video *pvp)
643 vvp->v_flag &= ~VFCHG; /* Changes done. */
644 pvp->v_flag = vvp->v_flag; /* Update model. */
645 pvp->v_hash = vvp->v_hash;
646 pvp->v_cost = vvp->v_cost;
647 pvp->v_color = vvp->v_color;
648 bcopy(vvp->v_text, pvp->v_text, ncol);
652 * updext: update the extended line which the cursor is currently on at a
653 * column greater than the terminal width. The line will be scrolled right or
654 * left to let the user see where the cursor is.
657 updext(int currow, int curcol)
659 struct line *lp; /* pointer to current line */
660 int j; /* index into line */
666 * calculate what column the left bound should be
667 * (force cursor into middle half of screen)
669 lbound = curcol - (curcol % (ncol >> 1)) - (ncol >> 2);
672 * scan through the line outputing characters to the virtual screen
673 * once we reach the left edge
675 vtmove(currow, -lbound); /* start scanning offscreen */
676 lp = curwp->w_dotp; /* line to output */
677 for (j = 0; j < llength(lp); ++j) /* until the end-of-line */
678 vtpute(lgetc(lp, j));
679 vteeol(); /* truncate the virtual line */
680 vscreen[currow]->v_text[0] = '$'; /* and put a '$' in column 1 */
684 * Update a single line. This routine only
685 * uses basic functionality (no insert and delete character,
686 * but erase to end of line). The "vvp" points at the video
687 * structure for the line on the virtual screen, and the "pvp"
688 * is the same for the physical screen. Avoid erase to end of
689 * line when updating CMODE color lines, because of the way that
690 * reverse video works on most terminals.
693 uline(int row, struct video *vvp, struct video *pvp)
702 if (vvp->v_color != pvp->v_color) { /* Wrong color, do a */
703 ttmove(row, 0); /* full redraw. */
704 #ifdef STANDOUT_GLITCH
705 if (pvp->v_color != CTEXT && magic_cookie_glitch >= 0)
708 ttcolor(vvp->v_color);
709 #ifdef STANDOUT_GLITCH
710 cp1 = &vvp->v_text[magic_cookie_glitch > 0 ? magic_cookie_glitch : 0];
712 * The odd code for magic_cookie_glitch==0 is to avoid
713 * putting the invisible glitch character on the next line.
714 * (Hazeltine executive 80 model 30)
716 cp2 = &vvp->v_text[ncol - (magic_cookie_glitch >= 0 ?
717 (magic_cookie_glitch != 0 ? magic_cookie_glitch : 1) : 0)];
719 cp1 = &vvp->v_text[0];
720 cp2 = &vvp->v_text[ncol];
726 #ifndef MOVE_STANDOUT
731 cp1 = &vvp->v_text[0]; /* Compute left match. */
732 cp2 = &pvp->v_text[0];
733 while (cp1 != &vvp->v_text[ncol] && cp1[0] == cp2[0]) {
737 if (cp1 == &vvp->v_text[ncol]) /* All equal. */
740 cp3 = &vvp->v_text[ncol]; /* Compute right match. */
741 cp4 = &pvp->v_text[ncol];
742 while (cp3[-1] == cp4[-1]) {
745 if (cp3[0] != ' ') /* Note non-blanks in */
746 nbflag = TRUE; /* the right match. */
748 cp5 = cp3; /* Is erase good? */
749 if (nbflag == FALSE && vvp->v_color == CTEXT) {
750 while (cp5 != cp1 && cp5[-1] == ' ')
753 if ((int) (cp3 - cp5) <= tceeol)
757 ttmove(row, (int) (cp1 - &vvp->v_text[0]));
758 #ifdef STANDOUT_GLITCH
759 if (vvp->v_color != CTEXT && magic_cookie_glitch > 0) {
760 if (cp1 < &vvp->v_text[magic_cookie_glitch])
761 cp1 = &vvp->v_text[magic_cookie_glitch];
762 if (cp5 > &vvp->v_text[ncol - magic_cookie_glitch])
763 cp5 = &vvp->v_text[ncol - magic_cookie_glitch];
764 } else if (magic_cookie_glitch < 0)
766 ttcolor(vvp->v_color);
771 if (cp5 != cp3) /* Do erase. */
776 * Redisplay the mode line for the window pointed to by the "wp".
777 * This is the only routine that has any idea of how the mode line is
778 * formatted. You can change the modeline format by hacking at this
779 * routine. Called by "update" any time there is a dirty window. Note
780 * that if STANDOUT_GLITCH is defined, first and last magic_cookie_glitch
781 * characters may never be seen.
784 modeline(struct mgwin *wp)
788 char sl[21]; /* Overkill. Space for 2^64 in base 10. */
791 n = wp->w_toprow + wp->w_ntrows; /* Location. */
792 vscreen[n]->v_color = CMODE; /* Mode line color. */
793 vscreen[n]->v_flag |= (VFCHG | VFHBAD); /* Recompute, display. */
794 vtmove(n, 0); /* Seek to right line. */
798 if ((bp->b_flag & BFREADONLY) != 0) {
800 if ((bp->b_flag & BFCHG) != 0)
804 } else if ((bp->b_flag & BFCHG) != 0) { /* "*" if changed. */
814 if (bp->b_bname[0] != '\0')
815 n += vtputs(&(bp->b_bname[0]));
816 while (n < 42) { /* Pad out with blanks. */
823 n += vtputs(bp->b_modes[md]->p_name);
824 if (++md > bp->b_nmodes)
829 /* XXX These should eventually move to a real mode */
830 if (macrodef == TRUE)
832 if (globalwd == TRUE)
838 len = snprintf(sl, sizeof(sl), "--L%d--C%d", wp->w_dotline,
840 if (len < sizeof(sl) && len != -1)
844 while (n < ncol) { /* Pad out. */
851 * Output a string to the mode line, report how long it was.
854 vtputs(const char *s)
866 * Compute the hash code for the line pointed to by the "vp".
867 * Recompute it if necessary. Also set the approximate redisplay
868 * cost. The validity of the hash code is marked by a flag bit.
869 * The cost understand the advantages of erase to end of line.
870 * Tuned for the VAX by Bob McNamara; better than it used to be on
871 * just about any machine.
874 hash(struct video *vp)
879 if ((vp->v_flag & VFHBAD) != 0) { /* Hash bad. */
880 s = &vp->v_text[ncol - 1];
881 for (i = ncol; i != 0; --i, --s)
884 n = ncol - i; /* Erase cheaper? */
887 vp->v_cost = i + n; /* Bytes + blanks. */
888 for (n = 0; i != 0; --i, --s)
889 n = (n << 5) + n + *s;
890 vp->v_hash = n; /* Hash code. */
891 vp->v_flag &= ~VFHBAD; /* Flag as all done. */
896 * Compute the Insert-Delete
897 * cost matrix. The dynamic programming algorithm
898 * described by James Gosling is used. This code assumes
899 * that the line above the echo line is the last line involved
900 * in the scroll region. This is easy to arrange on the VT100
901 * because of the scrolling region. The "offs" is the origin 0
902 * offset of the first row in the virtual/physical screen that
903 * is being updated; the "size" is the length of the chunk of
904 * screen being updated. For a full screen update, use offs=0
907 * Older versions of this code implemented the score matrix by
908 * a two dimensional array of SCORE nodes. This put all kinds of
909 * multiply instructions in the code! This version is written to
910 * use a linear array and pointers, and contains no multiplication
911 * at all. The code has been carefully looked at on the VAX, with
912 * only marginal checking on other machines for efficiency. In
913 * fact, this has been tuned twice! Bob McNamara tuned it even
914 * more for the VAX, which is a big issue for him because of
915 * the 66 line X displays.
917 * On some machines, replacing the "for (i=1; i<=size; ++i)" with
918 * i = 1; do { } while (++i <=size)" will make the code quite a
919 * bit better; but it looks ugly.
922 setscores(int offs, int size)
926 struct video **vp, **pp;
927 struct video **vbase, **pbase;
932 vbase = &vscreen[offs - 1]; /* By hand CSE's. */
933 pbase = &pscreen[offs - 1];
934 score[0].s_itrace = 0; /* [0, 0] */
935 score[0].s_jtrace = 0;
937 sp = &score[1]; /* Row 0, inserts. */
940 for (j = 1; j <= size; ++j) {
942 sp->s_jtrace = j - 1;
944 tempcost += (*vp)->v_cost;
945 sp->s_cost = tempcost;
949 sp = &score[nrow]; /* Column 0, deletes. */
951 for (i = 1; i <= size; ++i) {
952 sp->s_itrace = i - 1;
955 sp->s_cost = tempcost;
958 sp1 = &score[nrow + 1]; /* [1, 1]. */
960 for (i = 1; i <= size; ++i) {
963 for (j = 1; j <= size; ++j) {
964 sp->s_itrace = i - 1;
966 bestcost = (sp - nrow)->s_cost;
967 if (j != size) /* Cd(A[i])=0 @ Dis. */
969 tempcost = (sp - 1)->s_cost;
970 tempcost += (*vp)->v_cost;
971 if (i != size) /* Ci(B[j])=0 @ Dsj. */
973 if (tempcost < bestcost) {
975 sp->s_jtrace = j - 1;
978 tempcost = (sp - nrow - 1)->s_cost;
979 if ((*pp)->v_color != (*vp)->v_color
980 || (*pp)->v_hash != (*vp)->v_hash)
981 tempcost += (*vp)->v_cost;
982 if (tempcost < bestcost) {
983 sp->s_itrace = i - 1;
984 sp->s_jtrace = j - 1;
987 sp->s_cost = bestcost;
988 ++sp; /* Next column. */
992 sp1 += nrow; /* Next row. */
997 * Trace back through the dynamic programming cost
998 * matrix, and update the screen using an optimal sequence
999 * of redraws, insert lines, and delete lines. The "offs" is
1000 * the origin 0 offset of the chunk of the screen we are about to
1001 * update. The "i" and "j" are always started in the lower right
1002 * corner of the matrix, and imply the size of the screen.
1003 * A full screen traceback is called with offs=0 and i=j=nrow-1.
1004 * There is some do-it-yourself double subscripting here,
1005 * which is acceptable because this routine is much less compute
1006 * intensive then the code that builds the score matrix!
1009 traceback(int offs, int size, int i, int j)
1013 int ninsl, ndraw, ndell;
1015 if (i == 0 && j == 0) /* End of update. */
1017 itrace = score[(nrow * i) + j].s_itrace;
1018 jtrace = score[(nrow * i) + j].s_jtrace;
1019 if (itrace == i) { /* [i, j-1] */
1020 ninsl = 0; /* Collect inserts. */
1024 while (itrace != 0 || jtrace != 0) {
1025 if (score[(nrow * itrace) + jtrace].s_itrace != itrace)
1027 jtrace = score[(nrow * itrace) + jtrace].s_jtrace;
1032 traceback(offs, size, itrace, jtrace);
1035 ttinsl(offs + j - ninsl, offs + size - 1, ninsl);
1037 do { /* B[j], A[j] blank. */
1038 k = offs + j - ndraw;
1039 uline(k, vscreen[k], &blanks);
1043 if (jtrace == j) { /* [i-1, j] */
1044 ndell = 0; /* Collect deletes. */
1047 while (itrace != 0 || jtrace != 0) {
1048 if (score[(nrow * itrace) + jtrace].s_jtrace != jtrace)
1050 itrace = score[(nrow * itrace) + jtrace].s_itrace;
1056 ttdell(offs + i - ndell, offs + size - 1, ndell);
1058 traceback(offs, size, itrace, jtrace);
1061 traceback(offs, size, itrace, jtrace);
1063 uline(k, vscreen[k], pscreen[offs + i - 1]);