Strip selection from spaces when middle click opening

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.
This commit is contained in:
Christian Dywan 2009-03-19 23:37:32 +01:00
parent 7af8baee8b
commit 2421a3163f

View file

@ -807,7 +807,7 @@ gtk_widget_button_press_event_cb (WebKitWebView* web_view,
gtk_widget_get_display (GTK_WIDGET (view)), gtk_widget_get_display (GTK_WIDGET (view)),
GDK_SELECTION_PRIMARY); GDK_SELECTION_PRIMARY);
uri = gtk_clipboard_wait_for_text (clipboard); 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); new_uri = sokoke_magic_uri (uri, NULL);
if (event->state & GDK_CONTROL_MASK) if (event->state & GDK_CONTROL_MASK)