2022-01-26 23:38:46 -08:00
|
|
|
package engine
|
2019-03-13 04:14:30 -07:00
|
|
|
|
2020-11-14 23:47:00 -08:00
|
|
|
import (
|
|
|
|
"errors"
|
2020-12-06 10:34:42 -08:00
|
|
|
"fmt"
|
2022-03-24 04:53:20 -07:00
|
|
|
"oh-my-posh/color"
|
2022-01-26 01:23:18 -08:00
|
|
|
"oh-my-posh/environment"
|
2022-01-26 04:53:35 -08:00
|
|
|
"oh-my-posh/properties"
|
2022-01-26 06:54:36 -08:00
|
|
|
"oh-my-posh/segments"
|
2022-05-11 22:51:42 -07:00
|
|
|
"oh-my-posh/shell"
|
2022-01-26 06:54:36 -08:00
|
|
|
"oh-my-posh/template"
|
2021-11-11 23:40:08 -08:00
|
|
|
"runtime/debug"
|
2022-05-07 01:12:22 -07:00
|
|
|
"strings"
|
2021-04-18 10:16:06 -07:00
|
|
|
"time"
|
2020-11-14 23:47:00 -08:00
|
|
|
)
|
2020-09-17 07:51:29 -07:00
|
|
|
|
2020-11-12 00:43:32 -08:00
|
|
|
// Segment represent a single segment and it's configuration
|
2019-03-13 04:14:30 -07:00
|
|
|
type Segment struct {
|
2022-03-24 04:53:20 -07:00
|
|
|
Type SegmentType `json:"type,omitempty"`
|
|
|
|
Tips []string `json:"tips,omitempty"`
|
|
|
|
Style SegmentStyle `json:"style,omitempty"`
|
|
|
|
PowerlineSymbol string `json:"powerline_symbol,omitempty"`
|
|
|
|
InvertPowerline bool `json:"invert_powerline,omitempty"`
|
|
|
|
Foreground string `json:"foreground,omitempty"`
|
|
|
|
ForegroundTemplates color.Templates `json:"foreground_templates,omitempty"`
|
|
|
|
Background string `json:"background,omitempty"`
|
|
|
|
BackgroundTemplates color.Templates `json:"background_templates,omitempty"`
|
|
|
|
LeadingDiamond string `json:"leading_diamond,omitempty"`
|
|
|
|
TrailingDiamond string `json:"trailing_diamond,omitempty"`
|
2022-03-27 01:12:47 -07:00
|
|
|
Template string `json:"template,omitempty"`
|
2022-03-24 04:53:20 -07:00
|
|
|
Properties properties.Map `json:"properties,omitempty"`
|
2022-02-16 03:40:13 -08:00
|
|
|
|
|
|
|
writer SegmentWriter
|
2022-05-09 19:10:01 -07:00
|
|
|
Enabled bool `json:"-"`
|
2022-05-05 23:41:58 -07:00
|
|
|
text string
|
2022-02-16 03:40:13 -08:00
|
|
|
env environment.Environment
|
|
|
|
backgroundCache string
|
|
|
|
foregroundCache string
|
2019-03-13 04:14:30 -07:00
|
|
|
}
|
|
|
|
|
2021-04-18 10:16:06 -07:00
|
|
|
// SegmentTiming holds the timing context for a segment
|
|
|
|
type SegmentTiming struct {
|
2022-02-02 03:16:39 -08:00
|
|
|
name string
|
|
|
|
nameLength int
|
|
|
|
active bool
|
|
|
|
text string
|
|
|
|
duration time.Duration
|
2021-04-18 10:16:06 -07:00
|
|
|
}
|
|
|
|
|
2020-11-12 00:43:32 -08:00
|
|
|
// SegmentWriter is the interface used to define what and if to write to the prompt
|
2019-03-13 04:14:30 -07:00
|
|
|
type SegmentWriter interface {
|
2022-01-26 05:26:56 -08:00
|
|
|
Enabled() bool
|
|
|
|
Template() string
|
|
|
|
Init(props properties.Properties, env environment.Environment)
|
2019-03-13 04:14:30 -07:00
|
|
|
}
|
|
|
|
|
2022-02-09 02:03:58 -08:00
|
|
|
// SegmentStyle the style of segment, for more information, see the constants
|
2019-03-13 04:14:30 -07:00
|
|
|
type SegmentStyle string
|
|
|
|
|
2020-11-12 00:43:32 -08:00
|
|
|
// SegmentType the type of segment, for more information, see the constants
|
2019-03-13 04:14:30 -07:00
|
|
|
type SegmentType string
|
|
|
|
|
|
|
|
const (
|
2022-04-29 14:22:12 -07:00
|
|
|
// Plain writes it without ornaments
|
|
|
|
Plain SegmentStyle = "plain"
|
2022-04-11 03:40:20 -07:00
|
|
|
// Powerline writes it Powerline style
|
|
|
|
Powerline SegmentStyle = "powerline"
|
|
|
|
// Accordion writes it Powerline style but collapses the segment when disabled instead of hiding
|
|
|
|
Accordion SegmentStyle = "accordion"
|
|
|
|
// Diamond writes the prompt shaped with a leading and trailing symbol
|
|
|
|
Diamond SegmentStyle = "diamond"
|
|
|
|
|
2022-04-29 14:22:12 -07:00
|
|
|
// ANGULAR writes which angular cli version us currently active
|
|
|
|
ANGULAR SegmentType = "angular"
|
2022-01-26 05:10:18 -08:00
|
|
|
// AWS writes the active aws context
|
|
|
|
AWS SegmentType = "aws"
|
2022-04-29 14:22:12 -07:00
|
|
|
// AZ writes the Azure subscription info we're currently in
|
|
|
|
AZ SegmentType = "az"
|
2022-01-26 05:10:18 -08:00
|
|
|
// AZFUNC writes current AZ func version
|
|
|
|
AZFUNC SegmentType = "azfunc"
|
2022-04-29 14:22:12 -07:00
|
|
|
// BATTERY writes the battery percentage
|
|
|
|
BATTERY SegmentType = "battery"
|
|
|
|
// Brewfather segment
|
|
|
|
BREWFATHER SegmentType = "brewfather"
|
|
|
|
// cds (SAP CAP) version
|
|
|
|
CDS SegmentType = "cds"
|
|
|
|
// Cloud Foundry segment
|
|
|
|
CF SegmentType = "cf"
|
|
|
|
// Cloud Foundry logged in target
|
|
|
|
CFTARGET SegmentType = "cftarget"
|
|
|
|
// CMD writes the output of a shell command
|
|
|
|
CMD SegmentType = "command"
|
2022-01-26 05:10:18 -08:00
|
|
|
// CRYSTAL writes the active crystal version
|
|
|
|
CRYSTAL SegmentType = "crystal"
|
|
|
|
// DART writes the active dart version
|
|
|
|
DART SegmentType = "dart"
|
2022-04-29 14:22:12 -07:00
|
|
|
// DOTNET writes which dotnet version is currently active
|
|
|
|
DOTNET SegmentType = "dotnet"
|
|
|
|
// EXECUTIONTIME writes the execution time of the last run command
|
|
|
|
EXECUTIONTIME SegmentType = "executiontime"
|
|
|
|
// EXIT writes the last exit code
|
|
|
|
EXIT SegmentType = "exit"
|
|
|
|
// GIT represents the git status and information
|
|
|
|
GIT SegmentType = "git"
|
|
|
|
// GOLANG writes which go version is currently active
|
|
|
|
GOLANG SegmentType = "go"
|
|
|
|
// HASKELL segment
|
|
|
|
HASKELL SegmentType = "haskell"
|
|
|
|
// IPIFY segment
|
|
|
|
IPIFY SegmentType = "ipify"
|
|
|
|
// ITERM inserts the Shell Integration prompt mark on iTerm zsh/bash/fish
|
|
|
|
ITERM SegmentType = "iterm"
|
|
|
|
// JAVA writes the active java version
|
|
|
|
JAVA SegmentType = "java"
|
|
|
|
// JULIA writes which julia version is currently active
|
|
|
|
JULIA SegmentType = "julia"
|
|
|
|
// KOTLIN writes the active kotlin version
|
|
|
|
KOTLIN SegmentType = "kotlin"
|
|
|
|
// KUBECTL writes the Kubernetes context we're currently in
|
|
|
|
KUBECTL SegmentType = "kubectl"
|
2022-01-26 05:10:18 -08:00
|
|
|
// NBGV writes the nbgv version information
|
|
|
|
NBGV SegmentType = "nbgv"
|
2022-04-29 14:22:12 -07:00
|
|
|
// NIGHTSCOUT is an open source diabetes system
|
|
|
|
NIGHTSCOUT SegmentType = "nightscout"
|
|
|
|
// NODE writes which node version is currently active
|
|
|
|
NODE SegmentType = "node"
|
|
|
|
// npm version
|
|
|
|
NPM SegmentType = "npm"
|
|
|
|
// OS write os specific icon
|
|
|
|
OS SegmentType = "os"
|
2021-08-17 23:21:55 -07:00
|
|
|
// OWM writes the weather coming from openweatherdata
|
|
|
|
OWM SegmentType = "owm"
|
2022-04-29 14:22:12 -07:00
|
|
|
// PATH represents the current path segment
|
|
|
|
PATH SegmentType = "path"
|
2021-10-27 01:52:56 -07:00
|
|
|
// PHP writes which php version is currently active
|
|
|
|
PHP SegmentType = "php"
|
2022-04-29 14:22:12 -07:00
|
|
|
// PLASTIC represents the plastic scm status and information
|
|
|
|
PLASTIC SegmentType = "plastic"
|
|
|
|
// POSHGIT writes the posh git prompt
|
|
|
|
POSHGIT SegmentType = "poshgit"
|
|
|
|
// Project version
|
|
|
|
PROJECT SegmentType = "project"
|
|
|
|
// PYTHON writes the virtual env name
|
|
|
|
PYTHON SegmentType = "python"
|
|
|
|
// R version
|
|
|
|
R SegmentType = "r"
|
|
|
|
// ROOT writes root symbol
|
|
|
|
ROOT SegmentType = "root"
|
|
|
|
// RUBY writes which ruby version is currently active
|
|
|
|
RUBY SegmentType = "ruby"
|
|
|
|
// RUST writes the cargo version information if cargo.toml is present
|
|
|
|
RUST SegmentType = "rust"
|
|
|
|
// SESSION represents the user info segment
|
|
|
|
SESSION SegmentType = "session"
|
|
|
|
// SHELL writes which shell we're currently in
|
|
|
|
SHELL SegmentType = "shell"
|
|
|
|
// SPOTIFY writes the SPOTIFY status for Mac
|
|
|
|
SPOTIFY SegmentType = "spotify"
|
2022-01-26 05:10:18 -08:00
|
|
|
// STRAVA is a sports activity tracker
|
|
|
|
STRAVA SegmentType = "strava"
|
2022-04-29 14:22:12 -07:00
|
|
|
// SWIFT writes the active swift version
|
|
|
|
SWIFT SegmentType = "swift"
|
|
|
|
// SYSTEMINFO writes system information (memory, cpu, load)
|
|
|
|
SYSTEMINFO SegmentType = "sysinfo"
|
|
|
|
// TERRAFORM writes the terraform workspace we're currently in
|
|
|
|
TERRAFORM SegmentType = "terraform"
|
|
|
|
// TEXT writes a text
|
|
|
|
TEXT SegmentType = "text"
|
|
|
|
// TIME writes the current timestamp
|
|
|
|
TIME SegmentType = "time"
|
|
|
|
// UI5 Tooling segment
|
|
|
|
UI5TOOLING SegmentType = "ui5tooling"
|
2022-01-26 05:10:18 -08:00
|
|
|
// WAKATIME writes tracked time spend in dev editors
|
|
|
|
WAKATIME SegmentType = "wakatime"
|
|
|
|
// WIFI writes details about the current WIFI connection
|
|
|
|
WIFI SegmentType = "wifi"
|
|
|
|
// WINREG queries the Windows registry.
|
|
|
|
WINREG SegmentType = "winreg"
|
2022-04-29 14:22:12 -07:00
|
|
|
// YTM writes YouTube Music information and status
|
|
|
|
YTM SegmentType = "ytm"
|
2019-03-13 04:14:30 -07:00
|
|
|
)
|
|
|
|
|
2021-10-20 08:01:19 -07:00
|
|
|
func (segment *Segment) shouldIncludeFolder() bool {
|
2022-03-12 02:05:40 -08:00
|
|
|
if segment.env == nil {
|
|
|
|
return true
|
|
|
|
}
|
2021-10-20 08:01:19 -07:00
|
|
|
cwdIncluded := segment.cwdIncluded()
|
|
|
|
cwdExcluded := segment.cwdExcluded()
|
2022-02-09 02:03:58 -08:00
|
|
|
return cwdIncluded && !cwdExcluded
|
2021-02-27 20:05:51 -08:00
|
|
|
}
|
|
|
|
|
2022-04-11 03:40:20 -07:00
|
|
|
func (segment *Segment) isPowerline() bool {
|
|
|
|
return segment.Style == Powerline || segment.Style == Accordion
|
|
|
|
}
|
|
|
|
|
2021-10-20 08:01:19 -07:00
|
|
|
func (segment *Segment) cwdIncluded() bool {
|
2022-01-26 04:53:35 -08:00
|
|
|
value, ok := segment.Properties[properties.IncludeFolders]
|
2021-02-27 20:05:51 -08:00
|
|
|
if !ok {
|
|
|
|
// IncludeFolders isn't specified, everything is included
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2022-01-26 04:53:35 -08:00
|
|
|
list := properties.ParseStringArray(value)
|
2021-02-27 20:05:51 -08:00
|
|
|
|
|
|
|
if len(list) == 0 {
|
|
|
|
// IncludeFolders is an empty array, everything is included
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2022-04-06 00:05:17 -07:00
|
|
|
return segment.env.DirMatchesOneOf(segment.env.Pwd(), list)
|
2021-02-27 20:05:51 -08:00
|
|
|
}
|
|
|
|
|
2021-10-20 08:01:19 -07:00
|
|
|
func (segment *Segment) cwdExcluded() bool {
|
2022-01-26 04:53:35 -08:00
|
|
|
value, ok := segment.Properties[properties.ExcludeFolders]
|
2021-02-27 20:05:51 -08:00
|
|
|
if !ok {
|
2022-01-26 04:53:35 -08:00
|
|
|
value = segment.Properties[properties.IgnoreFolders]
|
2021-02-27 20:05:51 -08:00
|
|
|
}
|
2022-01-26 04:53:35 -08:00
|
|
|
list := properties.ParseStringArray(value)
|
2022-04-06 00:05:17 -07:00
|
|
|
return segment.env.DirMatchesOneOf(segment.env.Pwd(), list)
|
2020-10-02 07:58:25 -07:00
|
|
|
}
|
|
|
|
|
2021-06-05 07:14:44 -07:00
|
|
|
func (segment *Segment) shouldInvokeWithTip(tip string) bool {
|
|
|
|
for _, t := range segment.Tips {
|
|
|
|
if t == tip {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2021-02-13 07:27:31 -08:00
|
|
|
func (segment *Segment) foreground() string {
|
2022-02-16 03:40:13 -08:00
|
|
|
if len(segment.foregroundCache) == 0 {
|
2022-03-24 04:53:20 -07:00
|
|
|
segment.foregroundCache = segment.ForegroundTemplates.Resolve(segment.writer, segment.env, segment.Foreground)
|
2022-02-16 03:40:13 -08:00
|
|
|
}
|
|
|
|
return segment.foregroundCache
|
2021-02-13 07:27:31 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (segment *Segment) background() string {
|
2022-02-16 03:40:13 -08:00
|
|
|
if len(segment.backgroundCache) == 0 {
|
2022-03-24 04:53:20 -07:00
|
|
|
segment.backgroundCache = segment.BackgroundTemplates.Resolve(segment.writer, segment.env, segment.Background)
|
2022-02-16 03:40:13 -08:00
|
|
|
}
|
|
|
|
return segment.backgroundCache
|
2021-02-13 07:27:31 -08:00
|
|
|
}
|
|
|
|
|
2022-01-26 01:23:18 -08:00
|
|
|
func (segment *Segment) mapSegmentWithWriter(env environment.Environment) error {
|
2021-05-26 12:12:58 -07:00
|
|
|
segment.env = env
|
2019-03-13 04:14:30 -07:00
|
|
|
functions := map[SegmentType]SegmentWriter{
|
2022-04-29 14:22:12 -07:00
|
|
|
ANGULAR: &segments.Angular{},
|
|
|
|
AWS: &segments.Aws{},
|
|
|
|
AZ: &segments.Az{},
|
|
|
|
AZFUNC: &segments.AzFunc{},
|
|
|
|
BATTERY: &segments.Battery{},
|
|
|
|
BREWFATHER: &segments.Brewfather{},
|
|
|
|
CDS: &segments.Cds{},
|
|
|
|
CF: &segments.Cf{},
|
|
|
|
CFTARGET: &segments.CfTarget{},
|
|
|
|
CMD: &segments.Cmd{},
|
|
|
|
CRYSTAL: &segments.Crystal{},
|
|
|
|
DART: &segments.Dart{},
|
|
|
|
DOTNET: &segments.Dotnet{},
|
|
|
|
EXECUTIONTIME: &segments.Executiontime{},
|
|
|
|
EXIT: &segments.Exit{},
|
|
|
|
GIT: &segments.Git{},
|
|
|
|
GOLANG: &segments.Golang{},
|
|
|
|
HASKELL: &segments.Haskell{},
|
|
|
|
IPIFY: &segments.IPify{},
|
|
|
|
ITERM: &segments.ITerm{},
|
|
|
|
JAVA: &segments.Java{},
|
|
|
|
JULIA: &segments.Julia{},
|
|
|
|
KOTLIN: &segments.Kotlin{},
|
|
|
|
KUBECTL: &segments.Kubectl{},
|
|
|
|
NBGV: &segments.Nbgv{},
|
|
|
|
NIGHTSCOUT: &segments.Nightscout{},
|
|
|
|
NODE: &segments.Node{},
|
2022-03-10 09:41:48 -08:00
|
|
|
NPM: &segments.Npm{},
|
2022-04-29 14:22:12 -07:00
|
|
|
OS: &segments.Os{},
|
2022-01-26 06:54:36 -08:00
|
|
|
OWM: &segments.Owm{},
|
|
|
|
PATH: &segments.Path{},
|
2022-04-29 14:22:12 -07:00
|
|
|
PHP: &segments.Php{},
|
2022-01-26 06:54:36 -08:00
|
|
|
PLASTIC: &segments.Plastic{},
|
2022-04-29 14:22:12 -07:00
|
|
|
POSHGIT: &segments.PoshGit{},
|
|
|
|
PROJECT: &segments.Project{},
|
2022-01-26 06:54:36 -08:00
|
|
|
PYTHON: &segments.Python{},
|
2022-04-29 14:22:12 -07:00
|
|
|
R: &segments.R{},
|
2022-01-26 06:54:36 -08:00
|
|
|
ROOT: &segments.Root{},
|
|
|
|
RUBY: &segments.Ruby{},
|
|
|
|
RUST: &segments.Rust{},
|
2022-04-29 14:22:12 -07:00
|
|
|
SESSION: &segments.Session{},
|
|
|
|
SHELL: &segments.Shell{},
|
|
|
|
SPOTIFY: &segments.Spotify{},
|
2022-01-26 06:54:36 -08:00
|
|
|
STRAVA: &segments.Strava{},
|
2022-04-29 14:22:12 -07:00
|
|
|
SWIFT: &segments.Swift{},
|
|
|
|
SYSTEMINFO: &segments.SystemInfo{},
|
|
|
|
TERRAFORM: &segments.Terraform{},
|
|
|
|
TEXT: &segments.Text{},
|
|
|
|
TIME: &segments.Time{},
|
|
|
|
UI5TOOLING: &segments.UI5Tooling{},
|
2022-01-26 06:54:36 -08:00
|
|
|
WAKATIME: &segments.Wakatime{},
|
|
|
|
WIFI: &segments.Wifi{},
|
|
|
|
WINREG: &segments.WindowsRegistry{},
|
2022-04-29 14:22:12 -07:00
|
|
|
YTM: &segments.Ytm{},
|
2019-03-13 04:14:30 -07:00
|
|
|
}
|
2021-12-03 03:17:26 -08:00
|
|
|
if segment.Properties == nil {
|
2022-01-26 04:53:35 -08:00
|
|
|
segment.Properties = make(properties.Map)
|
2021-12-03 03:17:26 -08:00
|
|
|
}
|
2019-03-13 04:14:30 -07:00
|
|
|
if writer, ok := functions[segment.Type]; ok {
|
2022-01-26 05:26:56 -08:00
|
|
|
writer.Init(segment.Properties, env)
|
2019-03-13 04:14:30 -07:00
|
|
|
segment.writer = writer
|
2020-10-12 23:57:46 -07:00
|
|
|
return nil
|
2019-03-13 04:14:30 -07:00
|
|
|
}
|
2020-11-12 00:43:32 -08:00
|
|
|
return errors.New("unable to map writer")
|
2019-03-13 04:14:30 -07:00
|
|
|
}
|
2020-11-14 23:47:00 -08:00
|
|
|
|
2022-02-02 03:16:39 -08:00
|
|
|
func (segment *Segment) string() string {
|
2022-03-27 01:12:47 -07:00
|
|
|
if len(segment.Template) == 0 {
|
|
|
|
segment.Template = segment.writer.Template()
|
|
|
|
}
|
2022-02-02 03:16:39 -08:00
|
|
|
tmpl := &template.Text{
|
2022-03-27 01:12:47 -07:00
|
|
|
Template: segment.Template,
|
2022-02-02 03:16:39 -08:00
|
|
|
Context: segment.writer,
|
|
|
|
Env: segment.env,
|
|
|
|
}
|
|
|
|
text, err := tmpl.Render()
|
|
|
|
if err != nil {
|
|
|
|
return err.Error()
|
|
|
|
}
|
|
|
|
return text
|
|
|
|
}
|
|
|
|
|
2022-05-07 01:12:22 -07:00
|
|
|
func (segment *Segment) SetEnabled(env environment.Environment) {
|
2020-12-30 13:01:39 -08:00
|
|
|
defer func() {
|
|
|
|
err := recover()
|
|
|
|
if err == nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// display a message explaining omp failed(with the err)
|
2021-11-11 23:40:08 -08:00
|
|
|
message := fmt.Sprintf("\noh-my-posh fatal error rendering %s segment:%s\n\n%s\n", segment.Type, err, debug.Stack())
|
2020-12-30 13:01:39 -08:00
|
|
|
fmt.Println(message)
|
2022-05-07 01:12:22 -07:00
|
|
|
segment.Enabled = true
|
2020-12-30 13:01:39 -08:00
|
|
|
}()
|
2020-11-14 23:47:00 -08:00
|
|
|
err := segment.mapSegmentWithWriter(env)
|
2021-10-20 08:01:19 -07:00
|
|
|
if err != nil || !segment.shouldIncludeFolder() {
|
2020-11-14 23:47:00 -08:00
|
|
|
return
|
|
|
|
}
|
2022-02-02 03:16:39 -08:00
|
|
|
if segment.writer.Enabled() {
|
2022-05-07 01:12:22 -07:00
|
|
|
segment.Enabled = true
|
2022-05-05 23:41:58 -07:00
|
|
|
env.TemplateCache().AddSegmentData(string(segment.Type), segment.writer)
|
2020-11-14 23:47:00 -08:00
|
|
|
}
|
|
|
|
}
|
2022-05-07 01:12:22 -07:00
|
|
|
|
|
|
|
func (segment *Segment) SetText() {
|
|
|
|
if !segment.Enabled {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
segment.text = segment.string()
|
2022-05-11 22:51:42 -07:00
|
|
|
// see https://github.com/JanDeDobbeleer/oh-my-posh/discussions/2255
|
|
|
|
// this can't happen where we do regular text replacement in ansi.go
|
|
|
|
// as that would also replace valid \[\] sequences and break the prompt
|
2022-05-13 06:35:33 -07:00
|
|
|
// except for git bash on Windows
|
|
|
|
if segment.env.Shell() == shell.BASH && segment.env.Platform() != environment.WindowsPlatform {
|
2022-05-11 22:51:42 -07:00
|
|
|
segment.text = strings.ReplaceAll(segment.text, `\`, `\\`)
|
|
|
|
}
|
2022-05-07 01:12:22 -07:00
|
|
|
segment.Enabled = len(strings.ReplaceAll(segment.text, " ", "")) > 0
|
|
|
|
}
|