vte r2079 - in trunk: . src



Author: behdad
Date: Tue Aug  5 06:33:47 2008
New Revision: 2079
URL: http://svn.gnome.org/viewvc/vte?rev=2079&view=rev

Log:
2008-08-05  Behdad Esfahbod  <behdad gnome org>

        Bug 546366 â hard to select last tab char on a line

        * src/vte.c (vte_terminal_extend_selection):
        * src/vteseq.c (vte_sequence_handler_ta):
        Handle fragment cells.



Modified:
   trunk/ChangeLog
   trunk/src/vte.c
   trunk/src/vteseq.c

Modified: trunk/src/vte.c
==============================================================================
--- trunk/src/vte.c	(original)
+++ trunk/src/vte.c	Tue Aug  5 06:33:47 2008
@@ -6141,15 +6141,12 @@
 		rowdata = _vte_terminal_find_row_data(terminal, sc->y);
 		if (rowdata != NULL) {
 			/* Find the last non-empty character on the first line. */
-			last_nonempty = -1;
-			for (i = 0; i < rowdata->cells->len; i++) {
+			for (i = rowdata->cells->len - 1; i >= 0; i--) {
 				cell = &g_array_index(rowdata->cells,
 						struct vte_charcell, i);
-				if (cell->c != 0)
-					last_nonempty = i;
+				if (cell->attr.fragment || cell->c != 0)
+					break;
 			}
-			/* Now find the first empty after it. */
-			i = last_nonempty + 1;
 			/* If the start point is to its right, then move the
 			 * startpoint up to the beginning of the next line
 			 * unless that would move the startpoint after the end
@@ -6160,7 +6157,7 @@
 					sc->x = 0;
 					sc->y++;
 				} else {
-					sc->x = i;
+					sc->x = i + 1;
 				}
 			}
 		} else {
@@ -6175,18 +6172,15 @@
 		rowdata = _vte_terminal_find_row_data(terminal, ec->y);
 		if (rowdata != NULL) {
 			/* Find the last non-empty character on the last line. */
-			last_nonempty = -1;
-			for (i = 0; i < rowdata->cells->len; i++) {
+			for (i = rowdata->cells->len - 1; i >= 0; i--) {
 				cell = &g_array_index(rowdata->cells,
 						struct vte_charcell, i);
-				if (cell->c != 0)
-					last_nonempty = i;
+				if (cell->attr.fragment || cell->c != 0)
+					break;
 			}
-			/* Now find the first empty after it. */
-			i = last_nonempty + 1;
 			/* If the end point is to its right, then extend the
 			 * endpoint as far right as we can expect. */
-			if (ec->x >= i) {
+			if (ec->x > i) {
 				ec->x = MAX(ec->x,
 						MAX(terminal->column_count - 1,
 							rowdata->cells->len));

Modified: trunk/src/vteseq.c
==============================================================================
--- trunk/src/vteseq.c	(original)
+++ trunk/src/vteseq.c	Tue Aug  5 06:33:47 2008
@@ -2456,7 +2456,7 @@
 			int i;
 			i = rowdata->cells->len;
 			pcell = &g_array_index(rowdata->cells, struct vte_charcell, i - 1);
-			while ((i > col) && (pcell->c == 0))
+			while ((i > col) && !pcell->attr.fragment && pcell->c == 0)
 			{
 				i--;
 				pcell = &g_array_index(rowdata->cells, struct vte_charcell, i - 1);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]