@@ -6,6 +6,7 @@ package cmd
6
6
import (
7
7
"fmt"
8
8
"github.com/charmbracelet/bubbles/spinner"
9
+ "github.com/charmbracelet/bubbles/textarea"
9
10
"github.com/charmbracelet/bubbles/textinput"
10
11
tea "github.com/charmbracelet/bubbletea"
11
12
"github.com/cocoide/commitify/internal/entity"
@@ -31,7 +32,7 @@ type pushModel struct {
31
32
32
33
type prInput struct {
33
34
titleInput textinput.Model
34
- bodyInput textinput .Model
35
+ bodyInput textarea .Model
35
36
}
36
37
37
38
type PushCmdStep int
@@ -158,11 +159,11 @@ func (m *pushModel) View() string {
158
159
case SelectBaseBranch :
159
160
return m .buildSelectBaseBranchText ()
160
161
case ConfirmPR :
161
- return color .HiWhiteString ("<生成されたPRの確認: TabKeyで編集, EnterでPush>" ) + fmt .Sprintf ("\n \n Title: %s\n \n Body: %s" , m .pr .Title , m .pr .Body )
162
+ return color .HiWhiteString ("<生成されたPRの確認: TabKeyで編集, EnterでPush>" ) + fmt .Sprintf ("\n \n Title:\n %s\n \n Body:\n %s" , m .pr .Title , m .pr .Body )
162
163
case EditPRTitle :
163
- return color .HiWhiteString ("<Titleの編集: Enterで確定>" ) + fmt .Sprintf ("\n \n Title: %s\n \n Body: %s" , m .prInput .titleInput .View (), m .pr .Body )
164
+ return color .HiWhiteString ("<Titleの編集: Enterで確定>" ) + fmt .Sprintf ("\n \n Title:\n %s\n \n Body:\n %s" , m .prInput .titleInput .View (), m .pr .Body )
164
165
case EditPRBody :
165
- return color .HiWhiteString ("<Bodyの編集: EnterでPush>" ) + fmt .Sprintf ("\n \n Title: %s\n \n Body: %s" , m .pr .Title , m .prInput .bodyInput .View ())
166
+ return color .HiWhiteString ("<Bodyの編集: EnterでPush>" ) + fmt .Sprintf ("\n \n Title:\n %s\n \n Body:\n %s" , m .pr .Title , m .prInput .bodyInput .View ())
166
167
case SubmitPR :
167
168
return fmt .Sprintf ("**🎉PRの作成に成功**" )
168
169
}
@@ -196,7 +197,7 @@ func NewPushModel() *pushModel {
196
197
loadMsg : "" ,
197
198
prInput : & prInput {
198
199
titleInput : textinput .New (),
199
- bodyInput : textinput .New (),
200
+ bodyInput : textarea .New (),
200
201
},
201
202
}
202
203
}
@@ -255,7 +256,8 @@ func (m *pushModel) focusInPRBody() {
255
256
input .Focus ()
256
257
input .SetValue (m .pr .Body )
257
258
input .CharLimit = 1000
258
- input .Width = 500
259
+ input .SetWidth (100 )
260
+ input .SetHeight (len (m .pr .Body ) / 100 )
259
261
m .prInput .bodyInput = input
260
262
}
261
263
0 commit comments