Switch condition and returns.

This commit is contained in:
Žan V. Dragan 2025-01-19 13:05:58 +01:00
parent 90335672a9
commit 4d65edfb54

View file

@ -500,11 +500,11 @@ func (c *Command) SuggestFunc(typedName string) string {
if parent.suggestFunc != nil { if parent.suggestFunc != nil {
return parent.suggestFunc return parent.suggestFunc
} }
if parent.HasParent() { if !parent.HasParent() {
return getParentFunc(parent.Parent())
}
return nil return nil
} }
return getParentFunc(parent.Parent())
}
parentFunc := getParentFunc(c.Parent()) parentFunc := getParentFunc(c.Parent())
if parentFunc != nil { if parentFunc != nil {
return parentFunc(typedName) return parentFunc(typedName)