mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
fix: migrate text correctly
This commit is contained in:
parent
b9b789b513
commit
6b6aec43d5
|
@ -36,14 +36,6 @@ New-Alias -Name 'Set-PoshContext' -Value 'Set-EnvVar' -Scope Global -Force
|
||||||
|
|
||||||
## Template ([info][templates])
|
## Template ([info][templates])
|
||||||
|
|
||||||
:::note default template
|
|
||||||
|
|
||||||
``` template
|
|
||||||
{{ .Text }}
|
|
||||||
```
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
### Properties
|
### Properties
|
||||||
|
|
||||||
- `.Root`: `boolean` - is the current user root/admin or not
|
- `.Root`: `boolean` - is the current user root/admin or not
|
||||||
|
|
|
@ -43,7 +43,8 @@ func (segment *Segment) migrationOne(env environment.Environment) {
|
||||||
delete(segment.Properties, "enable_hyperlink")
|
delete(segment.Properties, "enable_hyperlink")
|
||||||
switch segment.Type { // nolint:exhaustive
|
switch segment.Type { // nolint:exhaustive
|
||||||
case TEXT:
|
case TEXT:
|
||||||
segment.migratePropertyValue("text", properties.SegmentTemplate)
|
segment.migratePropertyKey("text", properties.SegmentTemplate)
|
||||||
|
segment.migrateTemplate()
|
||||||
case GIT:
|
case GIT:
|
||||||
hasTemplate := segment.hasProperty(properties.SegmentTemplate)
|
hasTemplate := segment.hasProperty(properties.SegmentTemplate)
|
||||||
segment.migratePropertyKey("display_status", segments.FetchStatus)
|
segment.migratePropertyKey("display_status", segments.FetchStatus)
|
||||||
|
|
|
@ -8,12 +8,10 @@ import (
|
||||||
type Text struct {
|
type Text struct {
|
||||||
props properties.Properties
|
props properties.Properties
|
||||||
env environment.Environment
|
env environment.Environment
|
||||||
|
|
||||||
Text string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *Text) Template() string {
|
func (t *Text) Template() string {
|
||||||
return " {{ .Text }} "
|
return " "
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *Text) Enabled() bool {
|
func (t *Text) Enabled() bool {
|
||||||
|
|
Loading…
Reference in a new issue