Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.

Commit 802060d

Browse files
committed
Extension is no longer selected when renaming files from directory view
1 parent acd71ec commit 802060d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/directories.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,19 @@ Directories::Directories() : Gtk::ListViewText(1) {
293293

294294
EntryBox::get().hide();
295295
});
296+
296297
auto entry_it=EntryBox::get().entries.begin();
297298
entry_it->set_placeholder_text("Filename");
299+
298300
EntryBox::get().buttons.emplace_back("Rename file", [entry_it](){
299301
entry_it->activate();
300302
});
303+
301304
EntryBox::get().show();
305+
306+
auto end_pos=Glib::ustring(menu_popup_row_path.filename().string()).rfind('.');
307+
if(end_pos!=Glib::ustring::npos)
308+
entry_it->select_region(0, end_pos);
302309
});
303310
menu.append(menu_item_rename);
304311

0 commit comments

Comments
 (0)