Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion git_wapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ func commit(msg commitMsg) error {
_ = os.Remove(f.Name())
}()

_, err = fmt.Fprintf(f, "%s(%s): %s\n\n%s\n\n%s\n\n%s\n", msg.Type, msg.Scope, msg.Subject, msg.Body, msg.Footer, msg.SOB)
var scope string
if msg.Scope != "" {
scope = "(" + msg.Scope + ")"
}
_, err = fmt.Fprintf(f, "%s%s: %s\n\n%s\n\n%s\n\n%s\n", msg.Type, scope, msg.Subject, msg.Body, msg.Footer, msg.SOB)
if err != nil {
return err
}
Expand Down
7 changes: 6 additions & 1 deletion ui_commit_committing.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"strings"
"time"

"github.com/charmbracelet/bubbles/spinner"
Expand Down Expand Up @@ -114,7 +115,11 @@ func (m committingModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}

func (m committingModel) View() string {
header := committingTypeStyle.Render(m.msg.Type) + committingScopeStyle.Render("("+m.msg.Scope+")") + committingSubjectStyle.Render(": "+m.msg.Subject) + "\n"
var scope string
if strings.TrimSpace(m.msg.Scope) != "" {
scope = committingScopeStyle.Render("("+m.msg.Scope+")")
}
header := committingTypeStyle.Render(m.msg.Type) + scope + committingSubjectStyle.Render(": "+m.msg.Subject) + "\n"
body := committingBodyStyle.Render(m.msg.Body)
footer := committingFooterStyle.Render(m.msg.Footer+"\n"+m.msg.SOB) + "\n"

Expand Down
6 changes: 0 additions & 6 deletions ui_commit_inputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,6 @@ func newInputsModel() inputsModel {
iwc.input.PromptStyle = inputsPromptFocusStyle
iwc.input.TextStyle = inputsTextFocusStyle
iwc.input.Focus()
iwc.checker = func(s string) error {
if strings.TrimSpace(s) == "" {
return errors.New("Scope cannot be empty")
}
return nil
}
case 1:
iwc.input.Prompt = "2. SUBJECT "
iwc.input.PromptStyle = inputsPromptNormalStyle
Expand Down