@@ -14,7 +14,7 @@ type Presentation struct {
1414
1515func NewPresentation (config map [string ]interface {}) * Presentation {
1616 branch , _ := config ["branch" ].(string )
17-
17+
1818 var slides []* Slide
1919 if slidesData , ok := config ["slides" ].([]interface {}); ok {
2020 for _ , slideData := range slidesData {
@@ -25,15 +25,15 @@ func NewPresentation(config map[string]interface{}) *Presentation {
2525 }
2626 }
2727 }
28-
28+
2929 presentation := & Presentation {
3030 branch : branch ,
3131 slides : slides ,
3232 }
33-
33+
3434 // Find current slide based on current git HEAD
3535 presentation .currentSlide = presentation .findCurrentSlide ()
36-
36+
3737 return presentation
3838}
3939
@@ -46,14 +46,14 @@ func (p *Presentation) findCurrentSlide() *Slide {
4646 }
4747 return nil
4848 }
49-
49+
5050 sha := strings .TrimSpace (string (output ))
5151 for _ , slide := range p .slides {
5252 if slide .Commit () == sha {
5353 return slide
5454 }
5555 }
56-
56+
5757 if len (p .slides ) > 0 {
5858 return p .slides [0 ]
5959 }
@@ -93,12 +93,12 @@ func (p *Presentation) next() string {
9393 if len (p .slides ) == 0 {
9494 return "No slides available"
9595 }
96-
96+
9797 currentIndex := p .getCurrentSlideIndex ()
9898 if currentIndex == - 1 || currentIndex >= len (p .slides )- 1 {
9999 return p .currentSlide .Execute ()
100100 }
101-
101+
102102 p .currentSlide = p .slides [currentIndex + 1 ]
103103 return p .currentSlide .Execute ()
104104}
@@ -107,12 +107,12 @@ func (p *Presentation) previous() string {
107107 if len (p .slides ) == 0 {
108108 return "No slides available"
109109 }
110-
110+
111111 currentIndex := p .getCurrentSlideIndex ()
112112 if currentIndex <= 0 {
113113 return p .currentSlide .Execute ()
114114 }
115-
115+
116116 p .currentSlide = p .slides [currentIndex - 1 ]
117117 return p .currentSlide .Execute ()
118118}
@@ -129,7 +129,7 @@ func (p *Presentation) list() string {
129129 if len (p .slides ) == 0 {
130130 return "No slides available"
131131 }
132-
132+
133133 var result strings.Builder
134134 for _ , slide := range p .slides {
135135 if slide == p .currentSlide {
@@ -175,4 +175,4 @@ func (p *Presentation) StatusLine() string {
175175 }
176176 position := p .getCurrentSlideIndex () + 1
177177 return fmt .Sprintf ("%d/%d >" , position , len (p .slides ))
178- }
178+ }
0 commit comments