diff -uNr nautilus-2.3.3/components/tree/nautilus-tree-view.c nautilus-2.3.3-tree/components/tree/nautilus-tree-view.c
--- nautilus-2.3.3/components/tree/nautilus-tree-view.c	2003-04-02 12:36:11.000000000 +0200
+++ nautilus-2.3.3-tree/components/tree/nautilus-tree-view.c	2003-06-06 21:29:04.000000000 +0200
@@ -48,6 +48,7 @@
 #include <libnautilus-private/nautilus-global-preferences.h>
 #include <libnautilus-private/nautilus-program-choosing.h>
 #include <libnautilus-private/nautilus-tree-view-drag-dest.h>
+#include <src/nautilus-window-private.h>
 
 #define NAUTILUS_PREFERENCES_TREE_VIEW_EXPANSION_STATE "tree-sidebar-panel/expansion_state"
 
@@ -61,6 +62,8 @@
 	GHashTable   *expanded_uris;
 
 	NautilusTreeViewDragDest *drag_dest;
+
+	Nautilus_URI selection_location;
 };
 
 typedef struct {
@@ -71,6 +74,12 @@
 BONOBO_CLASS_BOILERPLATE (NautilusTreeView, nautilus_tree_view,
 			  NautilusView, NAUTILUS_TYPE_VIEW)
 
+static NautilusWindow *
+nautilus_tree_view_get_window (GtkWidget *view)
+{
+	return NAUTILUS_WINDOW (gtk_widget_get_ancestor (view, NAUTILUS_TYPE_WINDOW));
+}
+
 /*
  *   The expansion state storage is pretty broken
  * conceptually we have a gconf key, but we can't
@@ -276,7 +285,10 @@
 		}
 		   
 	} else if (uri != NULL) {	
-		nautilus_view_open_location_in_this_window (NAUTILUS_VIEW (view), uri);
+		if (strcmp (uri, view->details->selection_location) != 0) {
+			view->details->selection_location = g_strdup (uri);
+			nautilus_view_open_location_in_this_window (NAUTILUS_VIEW (view), uri);
+		}
 	}
 
 	g_free (uri);
@@ -503,6 +515,104 @@
 	update_filtering_from_preferences (NAUTILUS_TREE_VIEW (callback_data));
 }
 
+static gboolean
+show_iter_for_file (NautilusTreeView *view, NautilusFile *file, GtkTreeIter *iter)
+{
+	GtkTreeModel *model;
+	NautilusFile *parentFile;
+	GtkTreeIter parentIter;
+	NautilusFile *tmpFile;
+	gboolean valid;
+	GtkTreePath *path;
+	GtkTreePath *sort_path;
+
+	model = GTK_TREE_MODEL (view->details->child_model);
+
+	parentFile = nautilus_file_get_parent (file);
+	if (parentFile == NULL) {
+		return gtk_tree_model_get_iter_first (model, iter);
+	}
+	if (!show_iter_for_file (view, parentFile, &parentIter)) {
+		return FALSE;
+	}
+
+	if (gtk_tree_model_iter_has_child (model, &parentIter)) {
+		for (valid = gtk_tree_model_iter_nth_child (model, iter, &parentIter, 0);
+	             valid;
+        	     valid = gtk_tree_model_iter_next (model, iter)) {
+			tmpFile = nautilus_tree_model_iter_get_file (NAUTILUS_TREE_MODEL (model), iter);
+			if (tmpFile != NULL &&
+        	            strcmp(nautilus_file_get_uri (tmpFile),
+                                   nautilus_file_get_uri (file)) == 0) {
+				return TRUE;
+			}
+		}
+	}
+	
+	path = gtk_tree_model_get_path (model, &parentIter);
+	sort_path = gtk_tree_model_sort_convert_child_path_to_path
+		(view->details->sort_model, path);
+	gtk_tree_view_expand_row (view->details->tree_widget, sort_path, FALSE);
+
+	return FALSE;
+}
+
+static gboolean
+updating_selection_idle_callback (gpointer callback_data)
+{
+	NautilusTreeView *view;
+	NautilusFile *file;
+	GtkTreeIter iter;
+	GtkTreePath *path;
+	GtkTreePath *sort_path;
+	
+	view = NAUTILUS_TREE_VIEW (callback_data);
+
+	file = nautilus_file_get (view->details->selection_location);
+	if (!nautilus_file_is_directory (file)) {
+		file = nautilus_file_get_parent (file);
+	}
+	if (!show_iter_for_file (view, file, &iter)) {
+		return TRUE;
+	}
+	path = gtk_tree_model_get_path (GTK_TREE_MODEL (view->details->child_model), &iter); 
+	sort_path = gtk_tree_model_sort_convert_child_path_to_path
+		(view->details->sort_model, path);
+	gtk_tree_view_scroll_to_cell (view->details->tree_widget, sort_path, NULL, FALSE, 0, 0);
+	gtk_tree_view_set_cursor (view->details->tree_widget, sort_path, NULL, FALSE); 
+	gtk_tree_path_free (sort_path);
+
+	return FALSE;
+}
+
+static void
+history_changed_callback (NautilusTreeView       *view,
+			  const Nautilus_History *history,
+			  gpointer                callback_data)
+{
+	g_assert (view == callback_data);
+
+	NautilusWindow *window;
+	window = nautilus_tree_view_get_window (view->details->scrolled_window);
+	if (window == NULL) {
+		return;
+	}
+
+	if (window->details->location == NULL) {
+		return;
+	}
+	if (view->details->selection_location != NULL &&
+            strcmp (view->details->selection_location, window->details->location) == 0) {
+		return;
+	}
+	if (view->details->selection_location != NULL) {
+		g_free (view->details->selection_location);
+	}
+	view->details->selection_location = g_strdup (window->details->location);
+
+	g_idle_add (updating_selection_idle_callback, view);
+}
+
 static void
 nautilus_tree_view_instance_init (NautilusTreeView *view)
 {
@@ -526,6 +636,12 @@
 
 	nautilus_view_construct_from_bonobo_control (NAUTILUS_VIEW (view), control);
 
+	view->details->selection_location = NULL;
+	nautilus_view_set_listener_mask (NAUTILUS_VIEW (view),
+					 NAUTILUS_VIEW_LISTEN_HISTORY);
+	g_signal_connect_object (view, "history_changed",
+                                 G_CALLBACK (history_changed_callback), view, 0);
+ 
 	eel_preferences_add_callback (NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES,
 				      filtering_changed_callback, view);
 	eel_preferences_add_callback (NAUTILUS_PREFERENCES_SHOW_BACKUP_FILES,
