diff --git a/src/components/Files.vue b/src/components/Files.vue index f19b504..ca1aac8 100644 --- a/src/components/Files.vue +++ b/src/components/Files.vue @@ -29,13 +29,13 @@ const to = { } } */ -function parseFileStructure(ascii: string) { +function parseFileStructure(ascii:string, indent:number = 2) { const lines = ascii.split('\n') const root = { _: [] } const stack = [root] for (const line of lines) { - const depth = line.search(/\S/)/2 + const depth = line.search(/\S/)/indent const name = line.trim() const parent:{[name:string]:any} = stack[depth]