summaryrefslogtreecommitdiff
path: root/complete.go
diff options
context:
space:
mode:
Diffstat (limited to 'complete.go')
-rw-r--r--complete.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/complete.go b/complete.go
index 9ddfee2..2a4c905 100644
--- a/complete.go
+++ b/complete.go
@@ -78,6 +78,9 @@ func Complete(name string, cmd Completer) {
if err != nil {
panic("COMP_POINT env should be integer, got: " + point)
}
+ if i > len(line) {
+ i = len(line)
+ }
// Parse the command line up to the completion point.
args := arg.Parse(line[:i])