Merge pull request #13 from HeyPuter/ignore-delete-when-renaming-files

Don't delete files when delete key is pressed while renaming something
This commit is contained in:
Nariman Jelveh 2024-03-04 12:46:50 -08:00 committed by GitHub
commit e974b76c01
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1349,7 +1349,10 @@ window.initgui = async function(){
else{ else{
$selected_items = $(active_element).closest('.item-container').find('.item-selected'); $selected_items = $(active_element).closest('.item-container').find('.item-selected');
if($selected_items.length > 0){ if($selected_items.length > 0){
move_items($selected_items, trash_path); // Only delete the items if we're not renaming one.
if ($selected_items.children('.item-name-editor-active').length === 0) {
move_items($selected_items, trash_path);
}
} }
} }
} }