Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix completion init #42

Merged
merged 10 commits into from
Dec 18, 2023
5 changes: 5 additions & 0 deletions completer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
Expand Down