mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-02-01 13:21:09 -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
|
||||
type Block struct {
|
||||
env runtime.Environment
|
||||
Type BlockType `json:"type,omitempty" toml:"type,omitempty"`
|
||||
Alignment BlockAlignment `json:"alignment,omitempty" toml:"alignment,omitempty"`
|
||||
Filler string `json:"filler,omitempty" toml:"filler,omitempty"`
|
||||
Overflow Overflow `json:"overflow,omitempty" toml:"overflow,omitempty"`
|
||||
LeadingDiamond string `json:"leading_diamond,omitempty" toml:"leading_diamond,omitempty"`
|
||||
TrailingDiamond string `json:"trailing_diamond,omitempty" toml:"trailing_diamond,omitempty"`
|
||||
Segments []*Segment `json:"segments,omitempty" toml:"segments,omitempty"`
|
||||
VerticalOffset int `json:"vertical_offset,omitempty" toml:"vertical_offset,omitempty"`
|
||||
HorizontalOffset int `json:"horizontal_offset,omitempty" toml:"horizontal_offset,omitempty"`
|
||||
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"`
|
||||
env runtime.Environment
|
||||
Type BlockType `json:"type,omitempty" toml:"type,omitempty"`
|
||||
Alignment BlockAlignment `json:"alignment,omitempty" toml:"alignment,omitempty"`
|
||||
Filler string `json:"filler,omitempty" toml:"filler,omitempty"`
|
||||
Overflow Overflow `json:"overflow,omitempty" toml:"overflow,omitempty"`
|
||||
LeadingDiamond string `json:"leading_diamond,omitempty" toml:"leading_diamond,omitempty"`
|
||||
TrailingDiamond string `json:"trailing_diamond,omitempty" toml:"trailing_diamond,omitempty"`
|
||||
Segments []*Segment `json:"segments,omitempty" toml:"segments,omitempty"`
|
||||
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"`
|
||||
}
|
||||
|
||||
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
|
||||
case config.Prompt:
|
||||
if block.VerticalOffset != 0 {
|
||||
e.write(terminal.ChangeLine(block.VerticalOffset))
|
||||
}
|
||||
|
||||
if block.Alignment == config.Left {
|
||||
e.currentLineLength += length
|
||||
e.write(text)
|
||||
|
|
Loading…
Reference in a new issue