d6o / GoTree

A Tree printer module written in GoLang
https://disiqueira.github.io/GoTree/
MIT License
191 stars 32 forks source link

Multiline nodes #14

Closed Konstantin8105 closed 5 years ago

Konstantin8105 commented 5 years ago

May I create a feature for more beautiful view for node strings with "\n"(newlines). Could you clarify.

Prototype:

    artist := gotree.New("Pantera")
    album := artist.Add("Far Beyond\nDriven") // <<----- add newline here
    album.Add("5 minutes Alone")
    artist.Add("Power Metal")
    fmt.Println(artist.Print())

    // Output:
    // Pantera
    // ├───+ Far Beyond 
    // │   │ Driven                         // <<<<----- good view on new line
    // │   └── 5 minutes Alone
    // └── Power Metal
d6o commented 5 years ago

Hey @Konstantin8105 !

Yeap, ofc! I would be glad to merge it.

Sorry for taking long to answer, honestly I thought I had already answered it.