@@ -28,7 +28,7 @@ type Pipe struct {
2828 fromHash * string
2929 toHash * string
3030 kind PipeKind
31- style style.TextStyle
31+ style * style.TextStyle
3232}
3333
3434var highlightStyle = style .FgLightWhite .SetBold ()
@@ -41,7 +41,7 @@ func (self Pipe) right() int {
4141 return max (self .fromPos , self .toPos )
4242}
4343
44- func RenderCommitGraph (hashPool * utils.StringPool , commits []* models.Commit , selectedCommitHash * string , getStyle func (c * models.Commit ) style.TextStyle ) []string {
44+ func RenderCommitGraph (hashPool * utils.StringPool , commits []* models.Commit , selectedCommitHash * string , getStyle func (c * models.Commit ) * style.TextStyle ) []string {
4545 pipeSets := GetPipeSets (hashPool , commits , getStyle )
4646 if len (pipeSets ) == 0 {
4747 return nil
@@ -52,12 +52,12 @@ func RenderCommitGraph(hashPool *utils.StringPool, commits []*models.Commit, sel
5252 return lines
5353}
5454
55- func GetPipeSets (hashPool * utils.StringPool , commits []* models.Commit , getStyle func (c * models.Commit ) style.TextStyle ) [][]Pipe {
55+ func GetPipeSets (hashPool * utils.StringPool , commits []* models.Commit , getStyle func (c * models.Commit ) * style.TextStyle ) [][]Pipe {
5656 if len (commits ) == 0 {
5757 return nil
5858 }
5959
60- pipes := []Pipe {{fromPos : 0 , toPos : 0 , fromHash : hashPool .Add ("START" ), toHash : commits [0 ].Hash , kind : STARTS , style : style .FgDefault }}
60+ pipes := []Pipe {{fromPos : 0 , toPos : 0 , fromHash : hashPool .Add ("START" ), toHash : commits [0 ].Hash , kind : STARTS , style : & style .FgDefault }}
6161
6262 return lo .Map (commits , func (commit * models.Commit , _ int ) []Pipe {
6363 pipes = getNextPipes (hashPool , pipes , commit , getStyle )
@@ -102,7 +102,7 @@ func RenderAux(pipeSets [][]Pipe, commits []*models.Commit, selectedCommitHash *
102102 return lo .Flatten (chunks )
103103}
104104
105- func getNextPipes (hashPool * utils.StringPool , prevPipes []Pipe , commit * models.Commit , getStyle func (c * models.Commit ) style.TextStyle ) []Pipe {
105+ func getNextPipes (hashPool * utils.StringPool , prevPipes []Pipe , commit * models.Commit , getStyle func (c * models.Commit ) * style.TextStyle ) []Pipe {
106106 maxPos := 0
107107 for _ , pipe := range prevPipes {
108108 if pipe .toPos > maxPos {
@@ -294,10 +294,10 @@ func renderPipeSet(
294294 isMerge := startCount > 1
295295
296296 cells := lo .Map (lo .Range (maxPos + 1 ), func (i int , _ int ) * Cell {
297- return & Cell {cellType : CONNECTION , style : style .FgDefault }
297+ return & Cell {cellType : CONNECTION , style : & style .FgDefault }
298298 })
299299
300- renderPipe := func (pipe * Pipe , style style.TextStyle , overrideRightStyle bool ) {
300+ renderPipe := func (pipe * Pipe , style * style.TextStyle , overrideRightStyle bool ) {
301301 left := pipe .left ()
302302 right := pipe .right ()
303303
@@ -353,9 +353,9 @@ func renderPipeSet(
353353 }
354354 }
355355 for _ , pipe := range selectedPipes {
356- renderPipe (& pipe , highlightStyle , true )
356+ renderPipe (& pipe , & highlightStyle , true )
357357 if pipe .toPos == commitPos {
358- cells [pipe .toPos ].setStyle (highlightStyle )
358+ cells [pipe .toPos ].setStyle (& highlightStyle )
359359 }
360360 }
361361
0 commit comments