diff --git a/propertySet.go b/propertySet.go index 4cb8115..d5c07e2 100644 --- a/propertySet.go +++ b/propertySet.go @@ -513,22 +513,11 @@ func invalidPropertyValue(tag PropertyName, value any) { func isConstantName(text string) (bool, string) { len := len(text) - if len <= 1 || text[0] != '@' { + if len <= 1 || text[0] != '@' || + strings.ContainsAny(text, ",;|\"'`+(){}[]<>/\\*&%! \t\n\r") { return false, "" } - if len > 2 { - last := len - 1 - if (text[1] == '`' && text[last] == '`') || - (text[1] == '"' && text[last] == '"') || - (text[1] == '\'' && text[last] == '\'') { - return true, text[2:last] - } - } - - if strings.ContainsAny(text, ",;|\"'`+(){}[]<>/\\*&%! \t\n\r") { - return false, "" - } return true, text[1:] } diff --git a/sessionTheme.go b/sessionTheme.go index 21bb2e7..c0590bf 100644 --- a/sessionTheme.go +++ b/sessionTheme.go @@ -61,7 +61,7 @@ func (session *sessionData) resolveConstants(value string) (string, bool) { } func (session *sessionData) resolveConstantsNext(value string, prevTags []string) (string, bool) { - if !strings.Contains(value, "@") { + if !strings.ContainsRune(value, '@') { return value, true }