Skip to content

Commit

Permalink
Merge pull request #3 from masonkmeyer/bug-fixes
Browse files Browse the repository at this point in the history
general bug fixes
  • Loading branch information
masonkmeyer authored Oct 11, 2023
2 parents 291e294 + f69f6c5 commit 35af2ab
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion jet/ui/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func NewController(g *gocui.Gui, exitChannel chan string) *Controller {

// Quit is the handler for the quit keybinding
func (c *Controller) Quit(g *gocui.Gui, v *gocui.View) error {
go func() { c.exitChannel <- "" }()
return gocui.ErrQuit
}

Expand Down Expand Up @@ -110,13 +111,17 @@ func (c *Controller) onChange(item *viewmodel.MenuItem) error {
c.recentCommitMessage = results
c.g.DeleteView(LOGS)

graphLog := c.git.Logs(item.Value, "--graph", "--oneline", "--decorate", "--color", "--abbrev-commit", "--date=relative", "--format=format:%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)")
graphLog := c.git.Logs(item.Value, "--author-date-order", "--graph", "--oneline", "--decorate", "--color", "--abbrev-commit", "--date=relative", "--format=format:%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)")
c.gitGraph = graphLog
c.g.DeleteView(GRAPH)
return nil
}

// Pads the string with chars of length
func (c *Controller) pad(s string, padStr string, pLen int) string {
if pLen <= 0 {
return s
}

return fmt.Sprintf("%s%s", s, strings.Repeat(padStr, pLen))
}

0 comments on commit 35af2ab

Please sign in to comment.