mirror of
https://github.com/starship/starship.git
synced 2026-06-23 02:05:51 +07:00
feat: treat empty string as none when formating (#2738)
* treat empty string as none when formating * update docs * format & clippy
This commit is contained in:
@@ -107,7 +107,7 @@ A conditional format string wrapped in `(` and `)` will not render if all variab
|
||||
|
||||
For example:
|
||||
|
||||
- `(@$region)` will show nothing if the variable `region` is `None`, otherwise `@` followed by the value of region.
|
||||
- `(@$region)` will show nothing if the variable `region` is `None` or empty string, otherwise `@` followed by the value of region.
|
||||
- `(some text)` will always show nothing since there are no variables wrapped in the braces.
|
||||
- When `$all` is a shortcut for `\[$a$b\] `, `($all)` will show nothing only if `$a` and `$b` are both `None`.
|
||||
This works the same as `(\[$a$b\] )`.
|
||||
|
||||
Reference in New Issue
Block a user