Coder Social home page Coder Social logo

Comments (7)

ddddddO avatar ddddddO commented on June 12, 2024

https://github.com/fatih/color/issues

from gtree.

ddddddO avatar ddddddO commented on June 12, 2024

https://github.com/ddddddO/gtree/blame/9c860fd384c77dafd8351d927475128977f3423a/go.mod
github.com/fatih/color をv1.13に戻して、色ついたらcolor packageのバグ
そうでないならこちらのバグ
かなぁ

from gtree.

ddddddO avatar ddddddO commented on June 12, 2024

github.com/fatih/color をv1.13に戻しても色がつかなかったので、こちらのバグのよう

from gtree.

ddddddO avatar ddddddO commented on June 12, 2024

よくわからない

func (cs *colorizeSpreader) initialize(w io.Writer) {
	cs.fileColor = cs.fileColor.SetWriter(w)
	cs.dirColor = cs.dirColor.SetWriter(w)
}

こういう感じでやれば、色は出たけど、後の色だけしか出ない
SetWriterはv1.14で追加されたよう
https://pkg.go.dev/github.com/fatih/color#Color.SetWriter

from gtree.

ddddddO avatar ddddddO commented on June 12, 2024

commit遡って実行すればわかりそうだけど

from gtree.

ddddddO avatar ddddddO commented on June 12, 2024

growerで木の1行を作ってからspreaderで作った1行を色を付けて出力は筋が悪いかも

gtree/tree_grower.go

Lines 148 to 152 in 41c0b78

if current.isRoot() {
current.setBranch(current.name, "\n")
} else {
current.setBranch(current.branch(), " ", current.name, "\n")
}

枝の部分と名前の部分はgrowerで作ってもいいけど、それぞれを色指定して合わせて出力するのは、spreaderでやった方がいいかも

from gtree.

ddddddO avatar ddddddO commented on June 12, 2024

なおした

from gtree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.