commit 53672318a17b844495d628f4ef33fc7ff09f3315
parent a40588e25fabcfe13c8984486f17cc58eecc7f79
Author: Colin Leroy <colin@colino.net>
Date: Thu, 25 Oct 2012 10:19:38 +0000
2012-10-25 [colin] 3.8.1cvs107
* src/textview.c
Verify the previous URI wasn't the same...
fixes http://www. URIs.
Diffstat:
4 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,9 @@
+2012-10-25 [colin] 3.8.1cvs107
+
+ * src/textview.c
+ Verify the previous URI wasn't the same...
+ fixes http://www. URIs.
+
2012-10-25 [colin] 3.8.1cvs106
* src/common/utils.c
diff --git a/PATCHSETS b/PATCHSETS
@@ -4481,3 +4481,4 @@
( cvs diff -u -r 1.100.2.85 -r 1.100.2.86 AUTHORS; cvs diff -u -r 1.96.2.249 -r 1.96.2.250 src/textview.c; cvs diff -u -r 1.12.2.35 -r 1.12.2.36 src/textview.h; cvs diff -u -r 1.1.2.81 -r 1.1.2.82 src/gtk/authors.h; ) > 3.8.1cvs104.patchset
( cvs diff -u -r 1.96.2.250 -r 1.96.2.251 src/textview.c; ) > 3.8.1cvs105.patchset
( cvs diff -u -r 1.36.2.207 -r 1.36.2.208 src/common/utils.c; cvs diff -u -r 1.20.2.82 -r 1.20.2.83 src/common/utils.h; cvs diff -u -r 1.96.2.251 -r 1.96.2.252 src/textview.c; ) > 3.8.1cvs106.patchset
+( cvs diff -u -r 1.96.2.252 -r 1.96.2.253 src/textview.c; ) > 3.8.1cvs107.patchset
diff --git a/configure.ac b/configure.ac
@@ -12,7 +12,7 @@ MINOR_VERSION=8
MICRO_VERSION=1
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=106
+EXTRA_VERSION=107
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
diff --git a/src/textview.c b/src/textview.c
@@ -1388,11 +1388,18 @@ static void textview_make_clickable_parts(TextView *textview,
/* colorize this line */
if (head.next) {
const gchar *normal_text = mybuf;
+ struct txtpos *previous = NULL;
/* insert URIs */
for (last = head.next; last != NULL;
normal_text = last->ep, last = last->next) {
ClickableText *uri;
+
+ if (previous != NULL
+ && previous->bp < last->bp
+ && previous->ep == last->ep)
+ continue;
+
uri = g_new0(ClickableText, 1);
if (last->bp - normal_text > 0)
gtk_text_buffer_insert_with_tags_by_name
@@ -1410,6 +1417,7 @@ static void textview_make_clickable_parts(TextView *textview,
uri->filename = NULL;
textview->uri_list =
g_slist_prepend(textview->uri_list, uri);
+ previous = last;
}
if (*normal_text)
@@ -1501,12 +1509,19 @@ static void textview_make_clickable_parts_later(TextView *textview,
/* colorize this line */
if (head.next) {
+ struct txtpos *previous = NULL;
/* insert URIs */
for (last = head.next; last != NULL; last = last->next) {
ClickableText *uri;
gint start_offset, end_offset;
gchar *tmp_str;
gchar old_char;
+
+ if (previous != NULL
+ && previous->bp < last->bp
+ && previous->ep == last->ep)
+ continue;
+
uri = g_new0(ClickableText, 1);
uri->uri = parser[last->pti].build_uri(last->bp,
last->ep);
@@ -1533,6 +1548,7 @@ static void textview_make_clickable_parts_later(TextView *textview,
uri->filename = NULL;
textview->uri_list =
g_slist_prepend(textview->uri_list, uri);
+ previous = last;
}
}