Skip to content

Commit fd5758c

Browse files
authored
fix(prompt): initialization and update commit message handling (appleboy#190)
- Refactor `tea.NewProgram` initialization for better readability - Ensure `commitMessage` is updated with the value from `m.textarea` Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent 0396a59 commit fd5758c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/commit.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,13 @@ var commitCmd = &cobra.Command{
310310
}
311311

312312
if change {
313-
p := tea.NewProgram(initialPrompt(commitMessage))
313+
m := initialPrompt(commitMessage)
314+
p := tea.NewProgram(m)
314315
if _, err := p.Run(); err != nil {
315316
return err
316317
}
317318
p.Wait()
319+
commitMessage = m.textarea.Value()
318320
}
319321
}
320322

0 commit comments

Comments
 (0)