Skip to content

Commit

Permalink
bitcomplete hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswalz committed Oct 14, 2020
1 parent 5728e06 commit 8167817
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions bitcomplete/complete.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,20 @@ import (
func main() {
compLine := os.Getenv("COMP_LINE")
compPoint := os.Getenv("COMP_POINT")
i, err := strconv.Atoi(compPoint)
if err != nil {
fmt.Println("COMP_LINE", compLine, "COMP_POINT", compPoint, "err:", err)
return
}
if i > len(compLine) {
err := os.Setenv("COMP_POINT", strconv.Itoa(len(compLine)))
doInstall := os.Getenv("COMP_INSTALL") == "1"
doUninstall := os.Getenv("COMP_UNINSTALL") == "1"

if !doInstall && !doUninstall {
i, err := strconv.Atoi(compPoint)
if err != nil {
fmt.Println(err)
fmt.Println("COMP_LINE", compLine, "COMP_POINT", compPoint, "err:", err)
return
}
if i > len(compLine) {
err := os.Setenv("COMP_POINT", strconv.Itoa(len(compLine)))
if err != nil {
fmt.Println(err)
}
}
}

Expand Down

0 comments on commit 8167817

Please sign in to comment.