diff --git a/completer.go b/completer.go index 4babc24..d5ca4cc 100644 --- a/completer.go +++ b/completer.go @@ -10,6 +10,7 @@ import ( "unicode" "unicode/utf8" + "github.com/rsteube/carapace" "github.com/rsteube/carapace/pkg/style" completer "github.com/rsteube/carapace/pkg/x" "github.com/rsteube/carapace/pkg/xdg" @@ -20,6 +21,10 @@ import ( func (c *Console) complete(line []rune, pos int) readline.Completions { menu := c.activeMenu() + // Ensure the carapace library is called so that the function + // completer.Complete() variable is correctly initialized before use. + carapace.Gen(menu.Command) + // Split the line as shell words, only using // what the right buffer (up to the cursor) args, prefixComp, prefixLine := splitArgs(line, pos)