refactor: final_space is better name

I\'m coming for you Avocato
This commit is contained in:
Jan De Dobbeleer 2020-09-26 20:00:28 +02:00 committed by Jan De Dobbeleer
parent 1d8e7b2458
commit afaaace35b
17 changed files with 19 additions and 20 deletions

View file

@ -77,5 +77,5 @@
]
}
],
"end_space_enabled": true
"final_space": true
}

View file

@ -66,5 +66,5 @@
]
}
],
"end_space_enabled": true
"final_space": true
}

View file

@ -58,5 +58,5 @@
]
}
],
"end_space_enabled": true
"final_space": true
}

View file

@ -65,5 +65,5 @@
]
}
],
"end_space_enabled": true
"final_space": true
}

View file

@ -74,5 +74,5 @@
]
}
],
"end_space_enabled": true
"final_space": true
}

View file

@ -67,5 +67,5 @@
]
}
],
"end_space_enabled": true
"final_space": true
}

View file

@ -105,5 +105,5 @@
]
}
],
"end_space_enabled": true
"final_space": true
}

View file

@ -102,5 +102,5 @@
]
}
],
"end_space_enabled": true
"final_space": true
}

View file

@ -39,5 +39,5 @@
]
}
],
"end_space_enabled": true
"final_space": true
}

View file

@ -51,5 +51,5 @@
]
}
],
"end_space_enabled": true
"final_space": true
}

View file

@ -95,5 +95,5 @@
]
}
],
"end_space_enabled": true
"final_space": true
}

View file

@ -77,5 +77,5 @@
]
}
],
"end_space_enabled": true
"final_space": true
}

View file

@ -70,5 +70,5 @@
]
}
],
"end_space_enabled": true
"final_space": true
}

View file

@ -44,5 +44,5 @@
]
}
],
"end_space_enabled": true
"final_space": true
}

View file

@ -57,5 +57,5 @@
]
}
],
"end_space_enabled": true
"final_space": true
}

View file

@ -105,7 +105,6 @@ func (e *engine) renderBlockSegments(block *Block) string {
if e.previousActiveSegment != nil && e.previousActiveSegment.Style == Powerline {
e.writePowerLineSeparator(Transparent, e.previousActiveSegment.Background, true)
}
// e.endPowerline()
return e.renderer.string()
}
@ -130,7 +129,7 @@ func (e *engine) render() {
fmt.Print(e.renderBlockSegments(block))
}
}
if e.settings.EndSpaceEnabled {
if e.settings.FinalSpace {
fmt.Print(" ")
}
}

View file

@ -8,8 +8,8 @@ import (
//Settings holds all the theme for rendering the prompt
type Settings struct {
EndSpaceEnabled bool `json:"end_space_enabled"`
Blocks []*Block `json:"blocks"`
FinalSpace bool `json:"final_space"`
Blocks []*Block `json:"blocks"`
}
//BlockType type of block
@ -67,7 +67,7 @@ func loadUserConfiguration(env environmentInfo) (*Settings, error) {
func getDefaultSettings() *Settings {
settings := &Settings{
EndSpaceEnabled: true,
FinalSpace: true,
Blocks: []*Block{
{
Type: Prompt,