Skip to content

Commit

Permalink
Fix completion init (#42)
Browse files Browse the repository at this point in the history
* Use mvdan/sh for parsing and removing comments

* Update readline dep

* Update carapace dependency library

* Update readline dependency

* Ensure the completion function is initialized

* Update completer.go
  • Loading branch information
maxlandon authored Dec 18, 2023
1 parent 05223aa commit 813a38b
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit 813a38b

Please sign in to comment.