[vte/search] Fixup search a bit



commit 5e7bb0b7cbbd130eada9730b029270d822a69ef5
Author: Behdad Esfahbod <behdad behdad org>
Date:   Tue Apr 27 16:28:12 2010 -0400

    Fixup search a bit

 src/vte-private.h |    2 +-
 src/vte.c         |    9 +++++----
 2 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/vte-private.h b/src/vte-private.h
index 77ed099..991aa9d 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -319,7 +319,7 @@ struct _VteTerminalPrivate {
 
 	/* Search data. */
 	GRegex *search_regex;
-	gboolean *search_wrap_around;
+	gboolean search_wrap_around;
 
 	/* Data used when rendering the text which does not require server
 	 * resources and which can be kept after unrealizing. */
diff --git a/src/vte.c b/src/vte.c
index 90e973d..6d9ae89 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -14597,17 +14597,16 @@ vte_terminal_search_find_previous (VteTerminal *terminal)
 	if (!pvt->search_regex)
 		return result;
 
-	g_message ("has %d %d", pvt->has_selection, pvt->selection_start.row);
 	if (pvt->has_selection)
 		row = pvt->selection_start.row - 1;
 	else
 		row = MIN (pvt->screen->scroll_delta + terminal->row_count,
 			   _vte_ring_next (terminal->pvt->screen->row_data)) - 1;
-	g_message ("starting at %d", row);
 
+	/* TODO cache this */
 	attrs = g_array_new (FALSE, TRUE, sizeof (VteCharAttributes));
 
-	for (; row >= pvt->screen->insert_delta; row--) {
+	for (; row >= _vte_ring_delta (terminal->pvt->screen->row_data); row--) {
 		char *row_text;
 		GMatchInfo *match_info;
 		GError *error = NULL;
@@ -14641,7 +14640,6 @@ vte_terminal_search_find_previous (VteTerminal *terminal)
 		ca = &g_array_index (attrs, VteCharAttributes, start);
 		start_row = ca->row;
 		start_col = ca->column;
-		g_message ("Found: %s at (%ld,%ld)", word, ca->row, ca->column);
 		ca = &g_array_index (attrs, VteCharAttributes, end - 1);
 		end_row = ca->row;
 		end_col = ca->column;
@@ -14659,6 +14657,9 @@ vte_terminal_search_find_previous (VteTerminal *terminal)
 
 	g_array_free (attrs, TRUE);
 
+	if (!result)
+		vte_terminal_deselect_all (terminal);
+
 	return result;
 }
 



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