File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package main
33import (
44 tea "github.com/charmbracelet/bubbletea"
55 "github.com/mattn/go-runewidth"
6+ "strings"
67)
78
89const (
@@ -65,6 +66,8 @@ func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
6566
6667 // some special views need to determine the state of the data to update
6768 switch m .viewIndex {
69+ case INPUTS :
70+ return m , m .inputs
6871 case SPINNER :
6972 return m , m .commit
7073 case RESULT :
@@ -83,6 +86,10 @@ func (m model) View() string {
8386 return m .views [m .viewIndex ].View ()
8487}
8588
89+ func (m model ) inputs () tea.Msg {
90+ return strings .ToUpper (m .views [SELECTOR ].(selectorModel ).choice )
91+ }
92+
8693func (m model ) commit () tea.Msg {
8794 sob , err := createSOB ()
8895 if err != nil {
Original file line number Diff line number Diff line change @@ -112,6 +112,9 @@ func (m inputsModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
112112
113113 return m , tea .Batch (cmds ... )
114114 }
115+ case string :
116+ m .title = "✔ Commit Type: " + msg
117+ return m , nil
115118 }
116119
117120 // Handle character input and blinking
@@ -148,7 +151,7 @@ func (m inputsModel) View() string {
148151 }
149152 _ , _ = fmt .Fprint (& b , inputsButtonBlockStyle .Render (button ))
150153
151- title := inputsTitleBarStyle .Render (inputsTitleStyle .Render ("Input Other Messages" ))
154+ title := inputsTitleBarStyle .Render (inputsTitleStyle .Render (m . title ))
152155 inputs := inputsBlockStyle .Render (b .String ())
153156
154157 return lipgloss .JoinVertical (lipgloss .Left , title , inputs )
You can’t perform that action at this time.
0 commit comments