@@ -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 (
@@ -45,7 +45,7 @@ func (self Pipe) right() int {
4545 return max (self .fromPos , self .toPos )
4646}
4747
48- func RenderCommitGraph (commits []* models.Commit , selectedCommitHashPtr * string , getStyle func (c * models.Commit ) style.TextStyle ) []string {
48+ func RenderCommitGraph (commits []* models.Commit , selectedCommitHashPtr * string , getStyle func (c * models.Commit ) * style.TextStyle ) []string {
4949 pipeSets := GetPipeSets (commits , getStyle )
5050 if len (pipeSets ) == 0 {
5151 return nil
@@ -56,12 +56,12 @@ func RenderCommitGraph(commits []*models.Commit, selectedCommitHashPtr *string,
5656 return lines
5757}
5858
59- func GetPipeSets (commits []* models.Commit , getStyle func (c * models.Commit ) style.TextStyle ) [][]Pipe {
59+ func GetPipeSets (commits []* models.Commit , getStyle func (c * models.Commit ) * style.TextStyle ) [][]Pipe {
6060 if len (commits ) == 0 {
6161 return nil
6262 }
6363
64- pipes := []Pipe {{fromPos : 0 , toPos : 0 , fromHash : & StartCommitHash , toHash : commits [0 ].HashPtr (), kind : STARTS , style : style .FgDefault }}
64+ pipes := []Pipe {{fromPos : 0 , toPos : 0 , fromHash : & StartCommitHash , toHash : commits [0 ].HashPtr (), kind : STARTS , style : & style .FgDefault }}
6565
6666 return lo .Map (commits , func (commit * models.Commit , _ int ) []Pipe {
6767 pipes = getNextPipes (pipes , commit , getStyle )
@@ -106,7 +106,7 @@ func RenderAux(pipeSets [][]Pipe, commits []*models.Commit, selectedCommitHashPt
106106 return lo .Flatten (chunks )
107107}
108108
109- func getNextPipes (prevPipes []Pipe , commit * models.Commit , getStyle func (c * models.Commit ) style.TextStyle ) []Pipe {
109+ func getNextPipes (prevPipes []Pipe , commit * models.Commit , getStyle func (c * models.Commit ) * style.TextStyle ) []Pipe {
110110 maxPos := 0
111111 for _ , pipe := range prevPipes {
112112 if pipe .toPos > maxPos {
@@ -293,10 +293,10 @@ func renderPipeSet(
293293 isMerge := startCount > 1
294294
295295 cells := lo .Map (lo .Range (maxPos + 1 ), func (i int , _ int ) * Cell {
296- return & Cell {cellType : CONNECTION , style : style .FgDefault }
296+ return & Cell {cellType : CONNECTION , style : & style .FgDefault }
297297 })
298298
299- renderPipe := func (pipe * Pipe , style style.TextStyle , overrideRightStyle bool ) {
299+ renderPipe := func (pipe * Pipe , style * style.TextStyle , overrideRightStyle bool ) {
300300 left := pipe .left ()
301301 right := pipe .right ()
302302
@@ -352,9 +352,9 @@ func renderPipeSet(
352352 }
353353 }
354354 for _ , pipe := range selectedPipes {
355- renderPipe (& pipe , highlightStyle , true )
355+ renderPipe (& pipe , & highlightStyle , true )
356356 if pipe .toPos == commitPos {
357- cells [pipe .toPos ].setStyle (highlightStyle )
357+ cells [pipe .toPos ].setStyle (& highlightStyle )
358358 }
359359 }
360360
0 commit comments