<p><b>@kugel-</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/1813#discussion_r309701724">src/sidebar.c</a>:</p>
<pre style='color:#555'>> +/*
+ * Recursively copy all nodes from old parent to new parent
+ * */
+static void tree_copy_recursive(GtkTreeIter *parent_old, GtkTreeIter *parent_new)
+{
+       gint i;
+       GtkTreeIter child;
+       GtkTreeIter parent;
+       GtkTreePath *path;
+       GtkTreeModel *model = GTK_TREE_MODEL(store_openfiles);
+
+       path = gtk_tree_model_get_path(model, parent_old);
+       gtk_tree_path_free(path);
+       tree_copy_item(&parent, parent_old, parent_new);
+       i = gtk_tree_model_iter_n_children(model, parent_old) - 1;
+       while (i >= 0 && gtk_tree_model_iter_nth_child(model, &child, parent_old, i))
</pre>
<p>The original author probably copied the loop from <code>on_openfiles_document_action_apply()</code>. I changed it your suggestion which is a more natual fit.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/1813?email_source=notifications&email_token=AAIOWJ5SGBEB5WZJCNLA5QLQCLRVXA5CNFSM4EWIWKT2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCAJCPKA#discussion_r309701724">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ3FW6NDR457ZCRWBV3QCLRVXANCNFSM4EWIWKTQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/AAIOWJ6PH2QC6TWRS5M2HRDQCLRVXA5CNFSM4EWIWKT2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCAJCPKA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/1813?email_source=notifications\u0026email_token=AAIOWJ5SGBEB5WZJCNLA5QLQCLRVXA5CNFSM4EWIWKT2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCAJCPKA#discussion_r309701724",
"url": "https://github.com/geany/geany/pull/1813?email_source=notifications\u0026email_token=AAIOWJ5SGBEB5WZJCNLA5QLQCLRVXA5CNFSM4EWIWKT2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCAJCPKA#discussion_r309701724",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>