Skip to content

Commit

Permalink
Round took to Milliseconds
Browse files Browse the repository at this point in the history
  • Loading branch information
thetechnick committed Oct 16, 2020
1 parent 09791be commit 68def21
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions cmd/space-prompt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,8 @@ func (m *TookModule) Init(ctx *Context) error {
if ctx.Duration < time.Second*2 {
return nil
}
m.output = ` took %B%F{yellow}` + ctx.Duration.String() + `%b%f`

if ctx.Status == 0 {
m.output += "%B%K{black}%F{green} ✓ %k%f%b"
return nil
}
m.output += "%B%K{black}%F{red} ✗ %k%f%b"
m.output = ` took %B%F{yellow}` + ctx.Duration.Round(time.Millisecond).String() + `%b%f`
return nil
}

Expand Down Expand Up @@ -413,9 +408,9 @@ func (m *GitModule) Init(ctx *Context) error {
status += GitBehind
}

m.output = `%F{white} on%f%F{magenta}%B  ` + branch
m.output = `%F{white} on%f%F{magenta}%B  ` + branch + `%b%f`
if status != "" {
m.output += ` %F{red}[` + status + `]%b%f`
m.output += ` %F{red}[` + status + `]%f`
}
return nil
}
Expand Down

0 comments on commit 68def21

Please sign in to comment.