mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
feat: remove offset settings from block
BREAKING CHANGE: this is now completely deprecated and no longer supported
This commit is contained in:
parent
0c6ab9beac
commit
e7cbbde984
|
@ -34,19 +34,17 @@ const (
|
||||||
|
|
||||||
// Block defines a part of the prompt with optional segments
|
// Block defines a part of the prompt with optional segments
|
||||||
type Block struct {
|
type Block struct {
|
||||||
env runtime.Environment
|
env runtime.Environment
|
||||||
Type BlockType `json:"type,omitempty" toml:"type,omitempty"`
|
Type BlockType `json:"type,omitempty" toml:"type,omitempty"`
|
||||||
Alignment BlockAlignment `json:"alignment,omitempty" toml:"alignment,omitempty"`
|
Alignment BlockAlignment `json:"alignment,omitempty" toml:"alignment,omitempty"`
|
||||||
Filler string `json:"filler,omitempty" toml:"filler,omitempty"`
|
Filler string `json:"filler,omitempty" toml:"filler,omitempty"`
|
||||||
Overflow Overflow `json:"overflow,omitempty" toml:"overflow,omitempty"`
|
Overflow Overflow `json:"overflow,omitempty" toml:"overflow,omitempty"`
|
||||||
LeadingDiamond string `json:"leading_diamond,omitempty" toml:"leading_diamond,omitempty"`
|
LeadingDiamond string `json:"leading_diamond,omitempty" toml:"leading_diamond,omitempty"`
|
||||||
TrailingDiamond string `json:"trailing_diamond,omitempty" toml:"trailing_diamond,omitempty"`
|
TrailingDiamond string `json:"trailing_diamond,omitempty" toml:"trailing_diamond,omitempty"`
|
||||||
Segments []*Segment `json:"segments,omitempty" toml:"segments,omitempty"`
|
Segments []*Segment `json:"segments,omitempty" toml:"segments,omitempty"`
|
||||||
VerticalOffset int `json:"vertical_offset,omitempty" toml:"vertical_offset,omitempty"`
|
MaxWidth int `json:"max_width,omitempty" toml:"max_width,omitempty"`
|
||||||
HorizontalOffset int `json:"horizontal_offset,omitempty" toml:"horizontal_offset,omitempty"`
|
MinWidth int `json:"min_width,omitempty" toml:"min_width,omitempty"`
|
||||||
MaxWidth int `json:"max_width,omitempty" toml:"max_width,omitempty"`
|
Newline bool `json:"newline,omitempty" toml:"newline,omitempty"`
|
||||||
MinWidth int `json:"min_width,omitempty" toml:"min_width,omitempty"`
|
|
||||||
Newline bool `json:"newline,omitempty" toml:"newline,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *Block) Init(env runtime.Environment) {
|
func (b *Block) Init(env runtime.Environment) {
|
||||||
|
|
|
@ -205,10 +205,6 @@ func (e *Engine) renderBlock(block *config.Block, cancelNewline bool) bool {
|
||||||
|
|
||||||
switch block.Type { //nolint:exhaustive
|
switch block.Type { //nolint:exhaustive
|
||||||
case config.Prompt:
|
case config.Prompt:
|
||||||
if block.VerticalOffset != 0 {
|
|
||||||
e.write(terminal.ChangeLine(block.VerticalOffset))
|
|
||||||
}
|
|
||||||
|
|
||||||
if block.Alignment == config.Left {
|
if block.Alignment == config.Left {
|
||||||
e.currentLineLength += length
|
e.currentLineLength += length
|
||||||
e.write(text)
|
e.write(text)
|
||||||
|
|
Loading…
Reference in a new issue