From 5abf215403160f5cf6b7bc4e3dbc184b79dab6e5 Mon Sep 17 00:00:00 2001 From: nadrad Date: Fri, 16 Sep 2022 21:09:16 +0200 Subject: [PATCH] fixed the issue with pasting nothingness! --- h-m-m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/h-m-m b/h-m-m index 176ecfd..99125e2 100755 --- a/h-m-m +++ b/h-m-m @@ -2033,9 +2033,6 @@ function paste_sub_tree(&$mm, $as_sibling ) if ($as_sibling && $mm['active_node']==$mm['root']) return; - push_change($mm); - $mm['modified'] = true; - if ($as_sibling) $parent_id = $mm['nodes'][ $mm['active_node'] ]['parent']; else @@ -2055,8 +2052,12 @@ function paste_sub_tree(&$mm, $as_sibling ) ) ; - $mm['nodes'] += $st; + if ($st==[]) return; + push_change($mm); + $mm['modified'] = true; + + $mm['nodes'] += $st; // doing it like this, in case the sub-tree has more than // one top-level element.