1- package cmd
1+ package nav
22
33import tea "github.com/charmbracelet/bubbletea"
44
55var position = 0
66
7- type State struct {
7+ type state struct {
88 model tea.Model
9- next * State
10- previous * State
9+ next * state
10+ previous * state
1111}
1212
13- func NewState () * State {
14- return & State {}
13+ func NewState () * state {
14+ return & state {}
1515}
1616
17- func (s * State ) setCurrentCommand (m tea.Model ) {
17+ func (s * state ) setCurrentCommand (m tea.Model ) {
1818 if s .model == nil {
19- * s = State {
19+ * s = state {
2020 model : m ,
2121 next : s .next ,
2222 previous : s .previous ,
@@ -30,7 +30,7 @@ func (s *State) setCurrentCommand(m tea.Model) {
3030 s .model = m
3131}
3232
33- func (s * State ) NextCommand () tea.Model {
33+ func (s * state ) NextCommand () tea.Model {
3434 position += 1
3535 for range position {
3636 if s .next != nil {
@@ -41,9 +41,9 @@ func (s *State) NextCommand() tea.Model {
4141 return m
4242}
4343
44- func (s * State ) SetNextCommand (m tea.Model ) * State {
44+ func (s * state ) SetNextCommand (m tea.Model ) * state {
4545 if s .next == nil {
46- s .next = & State {
46+ s .next = & state {
4747 model : m ,
4848 next : nil ,
4949 previous : s ,
@@ -54,12 +54,12 @@ func (s *State) SetNextCommand(m tea.Model) *State {
5454 }
5555}
5656
57- func (s * State ) SetAndGetNextCommand (m tea.Model ) tea.Model {
57+ func (s * state ) SetAndGetNextCommand (m tea.Model ) tea.Model {
5858 s .setCurrentCommand (m )
5959 return s .NextCommand ()
6060}
6161
62- func (s * State ) PreviousCommand () tea.Model {
62+ func (s * state ) PreviousCommand () tea.Model {
6363 position -= 1
6464 for range position {
6565 if s .next != nil {
@@ -70,9 +70,9 @@ func (s *State) PreviousCommand() tea.Model {
7070 return m
7171}
7272
73- func (s * State ) SetPreviousCommand (m tea.Model ) * State {
73+ func (s * state ) SetPreviousCommand (m tea.Model ) * state {
7474 if s .previous == nil {
75- s .previous = & State {
75+ s .previous = & state {
7676 model : m ,
7777 next : s ,
7878 previous : nil ,
@@ -83,7 +83,7 @@ func (s *State) SetPreviousCommand(m tea.Model) *State {
8383 }
8484}
8585
86- func (s * State ) SetAndGetPreviousCommand (m tea.Model ) tea.Model {
86+ func (s * state ) SetAndGetPreviousCommand (m tea.Model ) tea.Model {
8787 s .setCurrentCommand (m )
8888 return s .PreviousCommand ()
8989}
0 commit comments