Index: src/vte.c
===================================================================
RCS file: /cvs/gnome/vte/src/vte.c,v
retrieving revision 1.425
diff -u -p -r1.425 vte.c
--- src/vte.c	10 Aug 2005 13:29:12 -0000	1.425
+++ src/vte.c	22 Aug 2005 04:43:28 -0000
@@ -119,11 +119,12 @@ typedef gunichar wint_t;
  * includes any supported visible attributes. */
 struct vte_charcell {
 	gunichar c;		/* The Unicode character. */
-	guint32 columns: 11;	/* Number of visible columns (as determined
+	guint32 columns: 10;	/* Number of visible columns (as determined
 				   by g_unicode_iswide(c)).  Use as many bits
 				   as possible without making this structure
 				   grow any larger. */
 	guint32 fragment: 1;	/* The nth fragment of a wide character. */
+	guint32 empty: 1;	/* Ignore this cell when copying. */
 	guint32 fore: 5;	/* Indices in the color palette for the */
 	guint32 back: 5;	/* foreground and background of the cell. */
 	guint32 standout: 1;	/* Single-bit attributes. */
@@ -579,6 +580,7 @@ vte_terminal_set_default_attributes(VteT
 	terminal->pvt->screen->defaults.c = ' ';
 	terminal->pvt->screen->defaults.columns = 1;
 	terminal->pvt->screen->defaults.fragment = 0;
+	terminal->pvt->screen->defaults.empty = 1;
 	terminal->pvt->screen->defaults.fore = VTE_DEF_FG;
 	terminal->pvt->screen->defaults.back = VTE_DEF_BG;
 	terminal->pvt->screen->defaults.reverse = 0;
@@ -5677,6 +5679,7 @@ vte_sequence_handler_screen_alignment_te
 		cell = screen->basic_defaults;
 		cell.c = 'E';
 		cell.columns = 1;
+		cell.empty = 0;
 		vte_g_array_fill(rowdata->cells, &cell, terminal->column_count);
 		vte_terminal_emit_text_inserted(terminal);
 	}
@@ -6933,6 +6936,7 @@ vte_terminal_insert_char(VteTerminal *te
 		pcell->c = cell.c;
 		pcell->columns = cell.columns;
 		pcell->fragment = cell.fragment;
+		pcell->empty = cell.empty;
 		pcell->alternate = 0;
 
 		/* Now set the character and column count. */
@@ -6949,12 +6953,14 @@ vte_terminal_insert_char(VteTerminal *te
 				pcell->c = c;
 				pcell->columns = columns;
 				pcell->fragment = 0;
+				pcell->empty = 0;
 			}
 		} else {
 			/* This is a continuation cell. */
 			pcell->c = c;
 			pcell->columns = columns;
 			pcell->fragment = 1;
+			pcell->empty = 0;
 		}
 
 		/* And take a step to the to the right. */
@@ -9366,7 +9372,7 @@ vte_terminal_get_text_range_maybe_wrappe
 								 ' ');
 				/* Record whether or not this was a
 				 * whitespace cell. */
-				if ((pcell->c == ' ') || (pcell->c == '\0')) {
+				if (pcell->empty) {
 					last_space = string->len - 1;
 					last_spacecol = col;
 				} else {
@@ -9409,7 +9415,7 @@ vte_terminal_get_text_range_maybe_wrappe
 					continue;
 				}
 				/* Check whether or not it holds whitespace. */
-				if ((pcell->c != ' ') && (pcell->c != '\0')) {
+				if (!pcell->empty) {
 					/* It holds non-whitespace, stop. */
 					break;
 				}
@@ -9441,16 +9447,9 @@ vte_terminal_get_text_range_maybe_wrappe
 							   row);
 			/* If it's whitespace, we snipped it off, so add a
 			 * newline, unless we soft-wrapped. */
-			if ((pcell == NULL) ||
-			    (pcell->c == '\0') ||
-			    (pcell->c == ' ')) {
-				if (vte_line_is_wrappable(terminal, row) &&
-				    wrap) {
-					string = g_string_append_c(string,
-								   pcell ?
-								   pcell->c :
-								   ' ');
-				} else {
+			if ((pcell == NULL) || pcell->empty) {
+				if (!vte_line_is_wrappable(terminal, row) ||
+				    !wrap) {
 					string = g_string_append_c(string,
 								   '\n');
 				}
@@ -9862,7 +9861,7 @@ vte_terminal_extend_selection(VteTermina
 		for (i = 0; i < rowdata->cells->len; i++) {
 			cell = &g_array_index(rowdata->cells,
 					      struct vte_charcell, i);
-			if (!g_unichar_isspace(cell->c) && (cell->c != '\0')) {
+			if (!cell->empty) {
 				last_nonspace = i;
 			}
 		}
@@ -9899,7 +9898,7 @@ vte_terminal_extend_selection(VteTermina
 		for (i = 0; i < rowdata->cells->len; i++) {
 			cell = &g_array_index(rowdata->cells,
 					      struct vte_charcell, i);
-			if (!g_unichar_isspace(cell->c) && (cell->c != '\0')) {
+			if (!cell->empty) {
 				last_nonspace = i;
 			}
 		}
