mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-27 11:59:40 -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])
|
||||
|
||||
:::note default template
|
||||
|
||||
``` template
|
||||
{{ .Text }}
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
### Properties
|
||||
|
||||
- `.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")
|
||||
switch segment.Type { // nolint:exhaustive
|
||||
case TEXT:
|
||||
segment.migratePropertyValue("text", properties.SegmentTemplate)
|
||||
segment.migratePropertyKey("text", properties.SegmentTemplate)
|
||||
segment.migrateTemplate()
|
||||
case GIT:
|
||||
hasTemplate := segment.hasProperty(properties.SegmentTemplate)
|
||||
segment.migratePropertyKey("display_status", segments.FetchStatus)
|
||||
|
|
|
@ -8,12 +8,10 @@ import (
|
|||
type Text struct {
|
||||
props properties.Properties
|
||||
env environment.Environment
|
||||
|
||||
Text string
|
||||
}
|
||||
|
||||
func (t *Text) Template() string {
|
||||
return " {{ .Text }} "
|
||||
return " "
|
||||
}
|
||||
|
||||
func (t *Text) Enabled() bool {
|
||||
|
|
Loading…
Reference in a new issue