[vte/vte-next: 193/223] Add match flags for search regex
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/vte-next: 193/223] Add match flags for search regex
- Date: Wed, 22 Jun 2011 21:04:49 +0000 (UTC)
commit 111c36d0da524e8060d8c85c670b9c6c45881570
Author: Christian Persch <chpe gnome org>
Date: Tue Jun 14 22:40:54 2011 +0200
Add match flags for search regex
src/vte-private.h | 1 +
src/vte.c | 10 ++++++++--
src/vte.h | 3 ++-
3 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/vte-private.h b/src/vte-private.h
index 55c967b..8e72ae1 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -323,6 +323,7 @@ struct _VteBufferPrivate {
/* Search data. */
GRegex *search_regex;
+ GRegexMatchFlags search_match_flags;
gboolean search_wrap_around;
GArray *search_attrs; /* Cache attrs */
diff --git a/src/vte.c b/src/vte.c
index 225496e..f96daa9 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -13168,6 +13168,7 @@ vte_buffer_write_contents_sync (VteBuffer *buffer,
* vte_terminal_search_set_gregex:
* @terminal: a #VteTerminal
* @regex: (allow-none): a #GRegex, or %NULL
+ * @flags: flags from #GRegexMatchFlags
*
* Sets the #GRegex regex to search for. Unsets the search regex when passed %NULL.
*
@@ -13175,7 +13176,8 @@ vte_buffer_write_contents_sync (VteBuffer *buffer,
*/
void
vte_terminal_search_set_gregex (VteTerminal *terminal,
- GRegex *regex)
+ GRegex *regex,
+ GRegexMatchFlags flags)
{
g_return_if_fail(VTE_IS_TERMINAL(terminal));
@@ -13190,6 +13192,8 @@ vte_terminal_search_set_gregex (VteTerminal *terminal,
if (regex)
terminal->pvt->search_regex = g_regex_ref (regex);
+ terminal->pvt->search_match_flags = flags;
+
_vte_invalidate_all (terminal);
}
@@ -13267,7 +13271,9 @@ vte_terminal_search_rows (VteTerminal *terminal,
row_text = vte_buffer_get_text_range (buffer, start_row, 0, end_row, -1, NULL, NULL, NULL);
- g_regex_match_full (pvt->search_regex, row_text, -1, 0, G_REGEX_MATCH_NOTEMPTY, &match_info, &error);
+ g_regex_match_full (pvt->search_regex, row_text, -1, 0,
+ pvt->search_match_flags | G_REGEX_MATCH_NOTEMPTY,
+ &match_info, &error);
if (error) {
g_printerr ("Error while matching: %s\n", error->message);
g_error_free (error);
diff --git a/src/vte.h b/src/vte.h
index 4d815a9..c3c83f9 100644
--- a/src/vte.h
+++ b/src/vte.h
@@ -176,7 +176,8 @@ char *vte_terminal_match_check(VteTerminal *terminal,
int *tag);
void vte_terminal_search_set_gregex (VteTerminal *terminal,
- GRegex *regex);
+ GRegex *regex,
+ GRegexMatchFlags flags);
GRegex *vte_terminal_search_get_gregex (VteTerminal *terminal);
void vte_terminal_search_set_wrap_around (VteTerminal *terminal,
gboolean wrap_around);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]