2012-10-25 [colin] 3.8.1cvs107
authorColin Leroy <colin@colino.net>
Thu, 25 Oct 2012 10:19:38 +0000 (10:19 +0000)
committerColin Leroy <colin@colino.net>
Thu, 25 Oct 2012 10:19:38 +0000 (10:19 +0000)
* src/textview.c
Verify the previous URI wasn't the same...
fixes http://www. URIs.

ChangeLog
PATCHSETS
configure.ac
src/textview.c

index 298ce34..62b2411 100644 (file)
--- 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
index 9b34efd..5b1874a 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( 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
index 60bbc15..9e9bad4 100644 (file)
@@ -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=
 
index 8dd8863..b47a881 100644 (file)
@@ -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;
                }
        }