mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
fix(block): do not print newline when empty
This commit is contained in:
parent
225f6c6b76
commit
014dc08e82
|
@ -166,6 +166,13 @@ 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 {
|
||||
return false
|
||||
}
|
||||
|
||||
defer e.applyPowerShellBleedPatch()
|
||||
|
||||
// do not print a newline to avoid a leading space
|
||||
|
@ -175,13 +182,6 @@ func (e *Engine) renderBlock(block *config.Block, cancelNewline bool) bool {
|
|||
e.writeNewline()
|
||||
}
|
||||
|
||||
text, length := e.writeBlockSegments(block)
|
||||
|
||||
// do not print anything when we don't have any text
|
||||
if length == 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
switch block.Type {
|
||||
case config.Prompt:
|
||||
if block.Alignment == config.Left {
|
||||
|
|
Loading…
Reference in a new issue