diff --git a/editor/src/menu.js b/editor/src/menu.js index c4cddd0..a4d01b7 100644 --- a/editor/src/menu.js +++ b/editor/src/menu.js @@ -5,10 +5,15 @@ import copy from 'copy-text-to-clipboard' function renderTree(tree) { if (!tree) return [] - return _.flatMapDeep(tree, (item) => [ - _.repeat(" ", item.indented) + item.text, - renderTree(item.children), - ]) + + let recRenderTree = (tree, indent) => { + return _.flatMapDeep(tree, (item) => [ + _.repeat(" ", item.indented-indent) + item.text, + recRenderTree(item.children, indent), + ]) + } + + return recRenderTree(tree, tree[0].indented) } function connectContextMenu(editor) {