diff --git a/completion.go b/completion.go index 57e82ee..946bfbb 100644 --- a/completion.go +++ b/completion.go @@ -47,6 +47,8 @@ func (c *CompletionManager) GetSelectedSuggestion() (s Suggest, ok bool) { debug.Assert(false, "must not reach here") c.selected = -1 return Suggest{}, false + } else if c.selected >= len(c.tmp) { + return Suggest{}, false } return c.tmp[c.selected], true }