From 53dc639cae958aea3293f6a02e0ac6de59b53b64 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Mon, 4 Mar 2024 13:52:22 +0000 Subject: [PATCH] Don't delete files when delete key is pressed while renaming something --- src/initgui.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/initgui.js b/src/initgui.js index 152125bb..d874a091 100644 --- a/src/initgui.js +++ b/src/initgui.js @@ -1349,7 +1349,10 @@ window.initgui = async function(){ else{ $selected_items = $(active_element).closest('.item-container').find('.item-selected'); 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); + } } } }