Skip to content

Commit

Permalink
Update Files.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Feb 26, 2024
1 parent 19af943 commit 120dd45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Files.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 120dd45

Please sign in to comment.