]> spindle.queued.net Git - midori/commitdiff
Strip selection from spaces when middle click opening
authorChristian Dywan <christian@twotoasts.de>
Thu, 19 Mar 2009 22:37:32 +0000 (23:37 +0100)
committerChristian Dywan <christian@twotoasts.de>
Thu, 19 Mar 2009 22:40:31 +0000 (23:40 +0100)
It happens every so often that you quickly select an address
and there's leading or trailing space you accidentally hit.
So we strip the selection, otherwise such addresses don't work.

midori/midori-view.c

index a7c5ff9be8d86037a088160dcb0d4bce0ebfa8ef..36b0b64d89b81d6b8332bc81936c84f9fad14e45 100644 (file)
@@ -807,7 +807,7 @@ gtk_widget_button_press_event_cb (WebKitWebView*  web_view,
                 gtk_widget_get_display (GTK_WIDGET (view)),
                 GDK_SELECTION_PRIMARY);
             uri = gtk_clipboard_wait_for_text (clipboard);
-            if (uri && strchr (uri, '.') && !strchr (uri, ' '))
+            if (uri && strchr (uri, '.') && !strchr (g_strstrip (uri), ' '))
             {
                 new_uri = sokoke_magic_uri (uri, NULL);
                 if (event->state & GDK_CONTROL_MASK)