mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-24 18:44:04 -08:00
parent
b0ecd21ce7
commit
57f18f8ed2
|
@ -36,4 +36,5 @@ type Block struct {
|
|||
MaxWidth int `json:"max_width,omitempty" toml:"max_width,omitempty"`
|
||||
MinWidth int `json:"min_width,omitempty" toml:"min_width,omitempty"`
|
||||
Newline bool `json:"newline,omitempty" toml:"newline,omitempty"`
|
||||
Force bool `json:"force,omitempty" toml:"force,omitempty"`
|
||||
}
|
||||
|
|
|
@ -196,8 +196,8 @@ func (e *Engine) getTitleTemplateText() string {
|
|||
func (e *Engine) renderBlock(block *config.Block, cancelNewline bool) bool {
|
||||
text, length := e.writeBlockSegments(block)
|
||||
|
||||
// do not print anything when we don't have any text
|
||||
if length == 0 {
|
||||
// do not print anything when we don't have any text unless forced
|
||||
if !block.Force && length == 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ import Config from "@site/src/components/Config.js";
|
|||
| `leading_diamond` | `string` |
|
||||
| `trailing_diamond` | `string` |
|
||||
| `segments` | `array` |
|
||||
| `force` | `boolean` |
|
||||
|
||||
### Type
|
||||
|
||||
|
@ -114,5 +115,9 @@ with the same trailing diamond, regardless of which segment is enabled or not.
|
|||
|
||||
Array of one or more [segments][segment].
|
||||
|
||||
### Force
|
||||
|
||||
When set to `true`, the block will always be rendered, even if all segments are empty. Defaults to `false`.
|
||||
|
||||
[color-overrides]: /docs/configuration/colors#color-overrides
|
||||
[segment]: segment.mdx
|
||||
|
|
Loading…
Reference in a new issue