Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Dec 2008 20:07:38 GMT
From:      Ed Schouten <ed@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 154362 for review
Message-ID:  <200812082007.mB8K7cIb015687@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=154362

Change 154362 by ed@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812082007.mB8K7cIb015687>