From f465f5061415e4f7c25c8d6181918ab075ea87e8 Mon Sep 17 00:00:00 2001 From: Joscha Date: Mon, 17 Feb 2025 01:34:44 +0100 Subject: [PATCH] Fix index bug when moving note downwards To reproduce: Move a note to a later position in the same parent. The note does not appear where it should. This can even panic when trying to move a note after the last child. --- gdn-app/src-tauri/src/store.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdn-app/src-tauri/src/store.rs b/gdn-app/src-tauri/src/store.rs index 2bac8e6..b55093a 100644 --- a/gdn-app/src-tauri/src/store.rs +++ b/gdn-app/src-tauri/src/store.rs @@ -212,7 +212,7 @@ impl Store { let mut to_idx = Self::resolve_child_position(&to.children, to_position); if from_id == to_id && from_idx < to_idx { - to_idx += 1; + to_idx -= 1; } let removed_id = self