gedit r6985 - in trunk: . gedit
- From: pborelli svn gnome org
- To: svn-commits-list gnome org
- Subject: gedit r6985 - in trunk: . gedit
- Date: Sat, 11 Apr 2009 12:59:08 +0000 (UTC)
Author: pborelli
Date: Sat Apr 11 12:59:08 2009
New Revision: 6985
URL: http://svn.gnome.org/viewvc/gedit?rev=6985&view=rev
Log:
2009-04-11 Paolo Borelli <pborelli katamail com>
* gedit/gedit-document.c: do not apply tags to the empty
string matches when clearing search highlighting.
Bug #578461, found by Zach Kanzler.
Modified:
trunk/ChangeLog
trunk/gedit/gedit-document.c
Modified: trunk/gedit/gedit-document.c
==============================================================================
--- trunk/gedit/gedit-document.c (original)
+++ trunk/gedit/gedit-document.c Sat Apr 11 12:59:08 2009
@@ -1976,22 +1976,22 @@
if (doc->priv->search_text == NULL)
return;
-
+
g_return_if_fail (doc->priv->num_of_lines_search_text > 0);
-
+
gtk_text_iter_backward_lines (start, doc->priv->num_of_lines_search_text);
gtk_text_iter_forward_lines (end, doc->priv->num_of_lines_search_text);
-
+
if (gtk_text_iter_has_tag (start, doc->priv->found_tag) &&
!gtk_text_iter_begins_tag (start, doc->priv->found_tag))
gtk_text_iter_backward_to_tag_toggle (start, doc->priv->found_tag);
-
+
if (gtk_text_iter_has_tag (end, doc->priv->found_tag) &&
!gtk_text_iter_ends_tag (end, doc->priv->found_tag))
gtk_text_iter_forward_to_tag_toggle (end, doc->priv->found_tag);
-
+
/*
- g_print ("[%u (%u), %u (%u)]\n", gtk_text_iter_get_line (start), gtk_text_iter_get_offset (start),
+ g_print ("[%u (%u), %u (%u)]\n", gtk_text_iter_get_line (start), gtk_text_iter_get_offset (start),
gtk_text_iter_get_line (end), gtk_text_iter_get_offset (end));
*/
@@ -2000,6 +2000,9 @@
start,
end);
+ if (*doc->priv->search_text == '\0')
+ return;
+
iter = *start;
search_flags = GTK_SOURCE_SEARCH_VISIBLE_ONLY | GTK_SOURCE_SEARCH_TEXT_ONLY;
@@ -2033,17 +2036,16 @@
if (!word)
continue;
}
-
+
if (found)
{
- /* g_print ("FOUND\n"); */
gtk_text_buffer_apply_tag (buffer,
doc->priv->found_tag,
&m_start,
&m_end);
}
- } while (found);
+ } while (found);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]