mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
refactor: remove error_icon property
This commit is contained in:
parent
71c610aaa8
commit
592f4147a2
|
@ -71,7 +71,7 @@
|
|||
"foreground": "#ffffff",
|
||||
"background": "#ff8080",
|
||||
"properties": {
|
||||
"error_icon": ""
|
||||
"prefix": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
"style": "plain",
|
||||
"foreground": "#C94A16",
|
||||
"properties": {
|
||||
"error_icon": "x"
|
||||
"prefix": "x"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
@ -46,8 +46,7 @@
|
|||
"style": "plain",
|
||||
"foreground": "#ffffff",
|
||||
"properties": {
|
||||
"error_icon": "x",
|
||||
"prefix": "<#CB4B16>[</>",
|
||||
"prefix": "<#CB4B16>[x</>",
|
||||
"postfix": "<#CB4B16>]</>"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
"style": "plain",
|
||||
"foreground": "#C94A16",
|
||||
"properties": {
|
||||
"error_icon": "x"
|
||||
"prefix": "x"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
"style": "plain",
|
||||
"foreground": "#ffffff",
|
||||
"properties": {
|
||||
"error_icon": " ",
|
||||
"prefix": " ",
|
||||
"postfix": ""
|
||||
}
|
||||
},
|
||||
|
|
|
@ -89,8 +89,7 @@
|
|||
"style": "plain",
|
||||
"foreground": "#CB4B16",
|
||||
"properties": {
|
||||
"prefix": "",
|
||||
"error_icon": ""
|
||||
"prefix": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
@ -91,12 +91,11 @@
|
|||
"leading_diamond": "",
|
||||
"trailing_diamond": "",
|
||||
"properties": {
|
||||
"error_icon": "",
|
||||
"display_exit_code": false,
|
||||
"always_enabled": true,
|
||||
"error_color": "#e91e63",
|
||||
"color_background": true,
|
||||
"prefix": "<#193549> </>"
|
||||
"prefix": "<#193549></> "
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
"style": "plain",
|
||||
"foreground": "#DCB977",
|
||||
"properties": {
|
||||
"error_icon": "✗",
|
||||
"prefix": "✗",
|
||||
"display_exit_code": false
|
||||
}
|
||||
},
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
"foreground": "#ffffff",
|
||||
"background": "#ff8080",
|
||||
"properties": {
|
||||
"error_icon": ""
|
||||
"prefix": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
"style": "plain",
|
||||
"foreground": "#DCB977",
|
||||
"properties": {
|
||||
"error_icon": "✗",
|
||||
"prefix": "✗",
|
||||
"display_exit_code": false
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,8 +92,7 @@
|
|||
"style": "plain",
|
||||
"foreground": "#D4E157",
|
||||
"properties": {
|
||||
"prefix": "",
|
||||
"error_icon": "❯",
|
||||
"prefix": "❯",
|
||||
"always_enabled": true,
|
||||
"error_color": "#FF5252",
|
||||
"display_exit_code": false
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
"foreground": "#ffffff",
|
||||
"background": "#ff8080",
|
||||
"properties": {
|
||||
"error_icon": ""
|
||||
"prefix": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
"style": "plain",
|
||||
"foreground": "#DCB977",
|
||||
"properties": {
|
||||
"error_icon": "✗",
|
||||
"prefix": "✗",
|
||||
"display_exit_code": false
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
"style": "plain",
|
||||
"foreground": "#CB4B16",
|
||||
"properties": {
|
||||
"error_icon": ""
|
||||
"prefix": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
"style": "plain",
|
||||
"foreground": "#C94A16",
|
||||
"properties": {
|
||||
"error_icon": "x"
|
||||
"prefix": "x"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
"style": "plain",
|
||||
"foreground": "#DCB977",
|
||||
"properties": {
|
||||
"error_icon": "✗",
|
||||
"prefix": "✗",
|
||||
"display_exit_code": false,
|
||||
"postfix": ""
|
||||
}
|
||||
|
|
|
@ -8,8 +8,6 @@ type exit struct {
|
|||
}
|
||||
|
||||
const (
|
||||
//ErrorIcon represents icon to display in case of error
|
||||
ErrorIcon Property = "error_icon"
|
||||
//DisplayExitCode shows or hides the error code
|
||||
DisplayExitCode Property = "display_exit_code"
|
||||
//AlwaysEnabled decides whether or not to always display the exitcode info
|
||||
|
@ -35,7 +33,6 @@ func (e *exit) init(props *properties, env environmentInfo) {
|
|||
}
|
||||
|
||||
func (e *exit) getFormattedText() string {
|
||||
errorIcon := e.props.getString(ErrorIcon, "X")
|
||||
exitCode := e.getMeaningFromExitCode()
|
||||
colorBackground := e.props.getBool(ColorBackground, false)
|
||||
if e.env.lastErrorCode() != 0 && !colorBackground {
|
||||
|
@ -44,7 +41,7 @@ func (e *exit) getFormattedText() string {
|
|||
if e.env.lastErrorCode() != 0 && colorBackground {
|
||||
e.props.background = e.props.getColor(ErrorColor, e.props.background)
|
||||
}
|
||||
return fmt.Sprintf("%s%s", errorIcon, exitCode)
|
||||
return exitCode
|
||||
}
|
||||
|
||||
func (e *exit) getMeaningFromExitCode() string {
|
||||
|
|
Loading…
Reference in a new issue