From 4d65edfb548d3f28c33a164d374f997c6dfe142d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDan=20V=2E=20Dragan?= Date: Sun, 19 Jan 2025 13:05:58 +0100 Subject: [PATCH] Switch condition and returns. --- command.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/command.go b/command.go index 2b15205..78abf4e 100644 --- a/command.go +++ b/command.go @@ -500,10 +500,10 @@ func (c *Command) SuggestFunc(typedName string) string { if parent.suggestFunc != nil { return parent.suggestFunc } - if parent.HasParent() { - return getParentFunc(parent.Parent()) + if !parent.HasParent() { + return nil } - return nil + return getParentFunc(parent.Parent()) } parentFunc := getParentFunc(c.Parent()) if parentFunc != nil {