Fix indent in renderTree, remove first indents
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
243c5df043
commit
5d924744de
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user