Skip to content

Commit

Permalink
fix index out of range when quickly typing and or changing suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswalz committed Nov 9, 2020
1 parent 8e6eb48 commit ca52eb9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit ca52eb9

Please sign in to comment.