Skip to content

Commit

Permalink
Merge pull request #961 from rsteube/xonsh-style-order
Browse files Browse the repository at this point in the history
xonsh: reverse style order
  • Loading branch information
rsteube authored Dec 18, 2023
2 parents ac69109 + b081a9a commit 1ac5077
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/shell/xonsh/style.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ func convertStyle(s string) string {
xonshStyle := make([]string, 0)

style := style.Parse("fg-default bg-default " + s)
switch style.Foreground {
switch style.Background {
case nil:
xonshStyle = append(xonshStyle, "fg:default")
xonshStyle = append(xonshStyle, "bg:default")
default:
xonshStyle = append(xonshStyle, "fg:"+convertColor(style.Foreground.String()))
xonshStyle = append(xonshStyle, "bg:"+convertColor(style.Background.String()))
}

switch style.Background {
switch style.Foreground {
case nil:
xonshStyle = append(xonshStyle, "bg:default")
xonshStyle = append(xonshStyle, "fg:default")
default:
xonshStyle = append(xonshStyle, "bg:"+convertColor(style.Background.String()))
xonshStyle = append(xonshStyle, "fg:"+convertColor(style.Foreground.String()))
}

if style.Bold {
Expand Down

0 comments on commit 1ac5077

Please sign in to comment.