Skip to content

Commit

Permalink
Fixes #131
Browse files Browse the repository at this point in the history
  • Loading branch information
justjanne committed Jul 3, 2019
1 parent cefe423 commit 2426b2e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 25 deletions.
53 changes: 29 additions & 24 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,30 +37,31 @@ type segment struct {
}

type args struct {
CwdMode *string
CwdMaxDepth *int
CwdMaxDirSize *int
ColorizeHostname *bool
EastAsianWidth *bool
PromptOnNewLine *bool
Mode *string
Theme *string
Shell *string
Modules *string
ModulesRight *string
Priority *string
MaxWidthPercentage *int
TruncateSegmentWidth *int
PrevError *int
NumericExitCodes *bool
IgnoreRepos *string
ShortenGKENames *bool
ShortenEKSNames *bool
ShellVar *string
PathAliases *string
Duration *string
Eval *bool
Condensed *bool
CwdMode *string
CwdMaxDepth *int
CwdMaxDirSize *int
ColorizeHostname *bool
EastAsianWidth *bool
PromptOnNewLine *bool
StaticPromptIndicator *bool
Mode *string
Theme *string
Shell *string
Modules *string
ModulesRight *string
Priority *string
MaxWidthPercentage *int
TruncateSegmentWidth *int
PrevError *int
NumericExitCodes *bool
IgnoreRepos *string
ShortenGKENames *bool
ShortenEKSNames *bool
ShellVar *string
PathAliases *string
Duration *string
Eval *bool
Condensed *bool
}

func (s segment) computeWidth(condensed bool) int {
Expand Down Expand Up @@ -170,6 +171,10 @@ func main() {
"newline",
false,
comments("Show the prompt on a new line")),
StaticPromptIndicator: flag.Bool(
"static-prompt-indicator",
false,
comments("Always show the prompt indicator with the default color, never with the error color")),
Mode: flag.String(
"mode",
"patched",
Expand Down
2 changes: 1 addition & 1 deletion powerline.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ func (p *powerline) draw() string {
buffer.WriteRune('\n')

var foreground, background uint8
if *p.args.PrevError == 0 {
if *p.args.PrevError == 0 || *p.args.StaticPromptIndicator {
foreground = p.theme.CmdPassedFg
background = p.theme.CmdPassedBg
} else {
Expand Down

0 comments on commit 2426b2e

Please sign in to comment.