Skip to content

Commit

Permalink
fix(prompt): initialization and update commit message handling (#190)
Browse files Browse the repository at this point in the history
- 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]>
  • Loading branch information
appleboy authored Jul 12, 2024
1 parent 0396a59 commit fd5758c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,13 @@ var commitCmd = &cobra.Command{
}

if change {
p := tea.NewProgram(initialPrompt(commitMessage))
m := initialPrompt(commitMessage)
p := tea.NewProgram(m)
if _, err := p.Run(); err != nil {
return err
}
p.Wait()
commitMessage = m.textarea.Value()
}
}

Expand Down

0 comments on commit fd5758c

Please sign in to comment.