diff options
author | Stefano Karapetsas <[email protected]> | 2012-01-15 13:24:41 -0800 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2012-01-15 13:24:41 -0800 |
commit | 81ad1b3760e41292620093a4cd143740f6af4f3a (patch) | |
tree | 84f394b157107433f3fd3424b461433cb22f1804 | |
parent | 31fb21b2dd8821af384279245baa518d80a57e0b (diff) | |
parent | 1ee81114ffe669470ae5db8d8b2ce92659cb7633 (diff) | |
download | caja-81ad1b3760e41292620093a4cd143740f6af4f3a.tar.bz2 caja-81ad1b3760e41292620093a4cd143740f6af4f3a.tar.xz |
Merge pull request #1 from benpicco/master
list-view: make sure not to select the extension on rename
-rw-r--r-- | src/file-manager/fm-list-view.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c index 1c82af9b..ca81b69f 100644 --- a/src/file-manager/fm-list-view.c +++ b/src/file-manager/fm-list-view.c @@ -1299,7 +1299,6 @@ cell_renderer_editing_started_cb (GtkCellRenderer *renderer, FMListView *list_view) { GtkEntry *entry; - gint start_offset, end_offset; entry = GTK_ENTRY (editable); list_view->details->editable_widget = editable; @@ -1308,9 +1307,6 @@ cell_renderer_editing_started_cb (GtkCellRenderer *renderer, g_free (list_view->details->original_name); list_view->details->original_name = g_strdup (gtk_entry_get_text (entry)); - eel_filename_get_rename_region (list_view->details->original_name, - &start_offset, &end_offset); - gtk_editable_select_region (GTK_EDITABLE (entry), start_offset, end_offset); caja_clipboard_set_up_editable (GTK_EDITABLE (entry), @@ -2842,6 +2838,7 @@ fm_list_view_start_renaming_file (FMDirectoryView *view, FMListView *list_view; GtkTreeIter iter; GtkTreePath *path; + gint start_offset, end_offset; list_view = FM_LIST_VIEW (view); @@ -2879,6 +2876,15 @@ fm_list_view_start_renaming_file (FMDirectoryView *view, list_view->details->file_name_column, TRUE); + /* set cursor also triggers editing-started, where we save the editable widget */ + if (list_view->details->editable_widget != NULL) { + eel_filename_get_rename_region (list_view->details->original_name, + &start_offset, &end_offset); + + gtk_editable_select_region (GTK_EDITABLE (list_view->details->editable_widget), + start_offset, end_offset); + } + gtk_tree_path_free (path); } |