PERFORCE change 154362 for review
Ed Schouten
ed at FreeBSD.org
Mon Dec 8 12:07:39 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=154362
Change 154362 by ed at ed_flippo on 2008/12/08 20:06:41
Fix remove of cutmarkings when copying/filling and fix the
history buffer.
Affected files ...
.. //depot/projects/mpsafetty/sys/dev/syscons/scterm-teken.c#16 edit
Differences ...
==== //depot/projects/mpsafetty/sys/dev/syscons/scterm-teken.c#16 (text+ko) ====
@@ -288,7 +288,10 @@
sc_vtb_putchar(&scp->vtb, p, map[ch], attr);
mark_for_update(scp, cursor);
- /* XXX: why? */
+ /*
+ * XXX: Why do we need this? Only marking `cursor' should be
+ * enough. Without this line, we get artifacts.
+ */
mark_for_update(scp, imin(cursor + 1, scp->xsize * scp->ysize - 1));
}
@@ -337,6 +340,7 @@
r->tr_begin.tp_row * scp->xsize + r->tr_begin.tp_col);
mark_for_update(scp,
(r->tr_end.tp_row - 1) * scp->xsize + (r->tr_end.tp_col - 1));
+ sc_remove_cutmarking(scp);
}
static void
@@ -346,6 +350,19 @@
unsigned int width;
int src, dst, end;
+#ifndef SC_NO_HISTORY
+ /*
+ * We count a line of input as history if we perform a copy of
+ * one whole line upward. In other words: if a line of text gets
+ * overwritten by a rectangle that's right below it.
+ */
+ if (scp->history != NULL &&
+ r->tr_begin.tp_col == 0 && r->tr_end.tp_col == scp->xsize &&
+ r->tr_begin.tp_row == p->tp_row + 1) {
+ sc_hist_save_one_line(scp, p->tp_row);
+ }
+#endif
+
if (r->tr_begin.tp_col == 0 && r->tr_end.tp_col == scp->xsize) {
/* Single contiguous region to copy. */
sc_vtb_move(&scp->vtb, r->tr_begin.tp_row * scp->xsize,
@@ -394,6 +411,7 @@
(p->tp_row + r->tr_end.tp_row - r->tr_begin.tp_row - 1) *
scp->xsize +
(p->tp_col + r->tr_end.tp_col - r->tr_begin.tp_col - 1));
+ sc_remove_cutmarking(scp);
}
static void
More information about the p4-projects
mailing list