]> Pileus Git - ~andy/gtk/commitdiff
Move the cursor to the end only if we highlight the completed match
authorFederico Mena Quintero <federico@gnu.org>
Thu, 13 Mar 2008 00:27:16 +0000 (00:27 +0000)
committerFederico Mena Quintero <federico@src.gnome.org>
Thu, 13 Mar 2008 00:27:16 +0000 (00:27 +0000)
Signed-off-by: Federico Mena Quintero <federico@gnu.org>
svn path=/trunk/; revision=19801

gtk/gtkfilechooserentry.c

index 33461336605f47e6f10f73c065a5992b708bfc9f..a6c6629640ef5a4b3443d600891d09af90b97ef5 100644 (file)
@@ -536,6 +536,8 @@ append_common_prefix (GtkFileChooserEntry *chooser_entry,
                                          chooser_entry->file_part_pos + common_prefix_len);
              chooser_entry->has_completion = TRUE;
            }
+         else
+           gtk_editable_set_position (GTK_EDITABLE (chooser_entry), GTK_ENTRY (chooser_entry)->text_length);
        }
 
       g_free (common_prefix);
@@ -786,8 +788,6 @@ gtk_file_chooser_entry_focus (GtkWidget        *widget,
       if (!chooser_entry->has_completion)
        append_common_prefix (chooser_entry, FALSE);
 
-      gtk_editable_set_position (editable, entry->text_length);
-
       /* Trigger the completion window to pop up again by a 
        * zero-length insertion, a bit of a hack.
        */