Skip to content

Commit 8167817

Browse files
committed
bitcomplete hotfix
1 parent 5728e06 commit 8167817

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

Diff for: bitcomplete/complete.go

+13-8
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,20 @@ import (
1616
func main() {
1717
compLine := os.Getenv("COMP_LINE")
1818
compPoint := os.Getenv("COMP_POINT")
19-
i, err := strconv.Atoi(compPoint)
20-
if err != nil {
21-
fmt.Println("COMP_LINE", compLine, "COMP_POINT", compPoint, "err:", err)
22-
return
23-
}
24-
if i > len(compLine) {
25-
err := os.Setenv("COMP_POINT", strconv.Itoa(len(compLine)))
19+
doInstall := os.Getenv("COMP_INSTALL") == "1"
20+
doUninstall := os.Getenv("COMP_UNINSTALL") == "1"
21+
22+
if !doInstall && !doUninstall {
23+
i, err := strconv.Atoi(compPoint)
2624
if err != nil {
27-
fmt.Println(err)
25+
fmt.Println("COMP_LINE", compLine, "COMP_POINT", compPoint, "err:", err)
26+
return
27+
}
28+
if i > len(compLine) {
29+
err := os.Setenv("COMP_POINT", strconv.Itoa(len(compLine)))
30+
if err != nil {
31+
fmt.Println(err)
32+
}
2833
}
2934
}
3035

0 commit comments

Comments
 (0)