Index: src/ephy-completion-model.c
===================================================================
--- src/ephy-completion-model.c	(revision 7019)
+++ src/ephy-completion-model.c	(working copy)
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /* 
  *  Copyright © 2002 Jorn Baayen <jorn@nl.linux.org>
  *
@@ -444,6 +445,29 @@ init_relevance_col (GValue *value, EphyN
 }
 
 static void
+init_url_col (GValue *value, EphyNode *node, int group)
+{
+        const char *url = NULL;
+
+	if (group == BOOKMARKS_GROUP)
+	{
+	        url = ephy_node_get_property_string
+		  (node, EPHY_NODE_BMK_PROP_LOCATION);
+	}
+	else if (group == HISTORY_GROUP)
+	{
+	        url = ephy_node_get_property_string
+		  (node, EPHY_NODE_PAGE_PROP_LOCATION);
+	}
+	else
+	{
+	        url = "";
+	}
+	
+	g_value_set_string (value, url);
+}
+
+static void
 ephy_completion_model_get_value (GtkTreeModel *tree_model,
 			         GtkTreeIter *iter,
 			         int column,
@@ -494,6 +518,10 @@ ephy_completion_model_get_value (GtkTree
 			g_value_init (value, G_TYPE_INT);
 			init_relevance_col (value, node, group);
 			break;
+                case EPHY_COMPLETION_URL_COL:
+                        g_value_init (value, G_TYPE_STRING);
+                        init_url_col (value, node, group);
+                        break;
 	}
 }
 
Index: src/ephy-completion-model.h
===================================================================
--- src/ephy-completion-model.h	(revision 7019)
+++ src/ephy-completion-model.h	(working copy)
@@ -42,6 +42,7 @@ typedef enum
 	EPHY_COMPLETION_RELEVANCE_COL,
 	EPHY_COMPLETION_EXTRA_COL,
 	EPHY_COMPLETION_FAVICON_COL,
+	EPHY_COMPLETION_URL_COL,
 	N_COL
 } EphyCompletionColumn;
 
Index: src/ephy-location-action.c
===================================================================
--- src/ephy-location-action.c	(revision 7019)
+++ src/ephy-location-action.c	(working copy)
@@ -370,7 +370,8 @@ connect_proxy (GtkAction *action, GtkWid
 						    EPHY_COMPLETION_KEYWORDS_COL,
 						    EPHY_COMPLETION_RELEVANCE_COL,
 						    EPHY_COMPLETION_EXTRA_COL,
-						    EPHY_COMPLETION_FAVICON_COL);
+						    EPHY_COMPLETION_FAVICON_COL,
+						    EPHY_COMPLETION_URL_COL);
 
 		add_completion_actions (action, proxy);
 
Index: lib/widgets/ephy-location-entry.c
===================================================================
--- lib/widgets/ephy-location-entry.c	(revision 7019)
+++ lib/widgets/ephy-location-entry.c	(working copy)
@@ -53,6 +53,7 @@
 #include <gtk/gtkseparatormenuitem.h>
 #include <gtk/gtkalignment.h>
 #include <gtk/gtkclipboard.h>
+#include <gtk/gtkversion.h>
 
 #include <string.h>
 
@@ -78,6 +79,7 @@ struct _EphyLocationEntryPrivate
 	guint relevance_col;
 	guint extra_col;
 	guint favicon_col;
+	guint url_col;
 
 	guint hash;
 
@@ -994,6 +996,27 @@ sort_func (GtkTreeModel *model,
 	return valueb - valuea;
 }
 
+#if GTK_CHECK_VERSION (2, 11, 0)
+static gboolean
+cursor_on_match_cb  (GtkEntryCompletion *completion,
+		     GtkTreeModel *model,
+		     GtkTreeIter *iter,
+		     EphyLocationEntry *le)
+{
+	char *item = NULL;
+
+	gtk_tree_model_get (model, iter,
+			    le->priv->url_col,
+			    &item, -1);
+
+	gtk_entry_completion_insert_completion_text (completion, item);
+
+	g_free (item);
+
+	return TRUE;
+}
+#endif /* GTK+ 2.11.0 */
+
 void
 ephy_location_entry_set_completion (EphyLocationEntry *le,
 				    GtkTreeModel *model,
@@ -1002,7 +1025,8 @@ ephy_location_entry_set_completion (Ephy
 				    guint keywords_col,
 				    guint relevance_col,
 				    guint extra_col,
-				    guint favicon_col)
+				    guint favicon_col,
+				    guint url_col)
 {
 	EphyLocationEntryPrivate *priv = le->priv;
 	GtkTreeModel *sort_model;
@@ -1015,6 +1039,7 @@ ephy_location_entry_set_completion (Ephy
 	le->priv->relevance_col = relevance_col;
 	le->priv->extra_col = extra_col;
 	le->priv->favicon_col = favicon_col;
+	le->priv->url_col = url_col;
 
 	sort_model = gtk_tree_model_sort_new_with_model (model);
 	g_object_unref (model);
@@ -1062,6 +1087,12 @@ ephy_location_entry_set_completion (Ephy
 	gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (completion),
 				       extracell, "text", extra_col);
 
+#if GTK_CHECK_VERSION (2, 11, 0)
+	g_object_set (completion, "inline-selection", TRUE, NULL);
+	g_signal_connect (completion, "cursor-on-match",
+			  G_CALLBACK (cursor_on_match_cb), le);
+#endif
+
 	gtk_entry_set_completion (GTK_ENTRY (priv->icon_entry->entry), completion);
 	g_object_unref (completion);
 }
Index: lib/widgets/ephy-location-entry.h
===================================================================
--- lib/widgets/ephy-location-entry.h	(revision 7019)
+++ lib/widgets/ephy-location-entry.h	(working copy)
@@ -73,7 +73,8 @@ void		ephy_location_entry_set_completion
 							 guint keywords_col,
 							 guint relevance_col,
 							 guint extra_col,
-							 guint favicon_col);
+							 guint favicon_col,
+							 guint url_col);
 
 void		ephy_location_entry_set_location	(EphyLocationEntry *le,
 							 const char *address,
