Only auto-insert the prefix if we are at the end of the text

Signed-off-by: Federico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=19799
This commit is contained in:
Federico Mena Quintero 2008-03-13 00:26:20 +00:00 committed by Federico Mena Quintero
parent 795727aad4
commit 833e32fa08

View File

@ -558,8 +558,9 @@ check_completion_callback (GtkFileChooserEntry *chooser_entry)
* the "open" modes. For "save" modes, the user must hit Tab to cause the prefix
* to be inserted. That happens in gtk_file_chooser_entry_focus().
*/
if (chooser_entry->action == GTK_FILE_CHOOSER_ACTION_OPEN
|| chooser_entry->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
if ((chooser_entry->action == GTK_FILE_CHOOSER_ACTION_OPEN
|| chooser_entry->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
&& gtk_editable_get_position (GTK_EDITABLE (chooser_entry)) == GTK_ENTRY (chooser_entry)->text_length)
append_common_prefix (chooser_entry, TRUE);
done: