diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2010-04-27 16:28:12 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2010-04-27 16:28:12 -0400 |
commit | 5e7bb0b7cbbd130eada9730b029270d822a69ef5 (patch) | |
tree | 546750e9ed3c00f4af3cb9a414dbfcb8be7f88db | |
parent | ed1c3e4ba7aa3a6a3d4eea9dc30b6356f91c26b9 (diff) | |
download | vte-5e7bb0b7cbbd130eada9730b029270d822a69ef5.tar.gz |
Fixup search a bitsearch
-rw-r--r-- | src/vte-private.h | 2 | ||||
-rw-r--r-- | src/vte.c | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/vte-private.h b/src/vte-private.h index 77ed0995..991aa9de 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. */ @@ -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; } |