diff --git a/scheme/completer.scm b/scheme/completer.scm index aa89874..df61ec6 100644 --- a/scheme/completer.scm +++ b/scheme/completer.scm @@ -143,11 +143,13 @@ (lambda (completed-line cursor-index) (list completed-line '() cursor-index to-complete parsed)))) (else - (let ((common-prefix (strings-common-prefix completions))) + (let ((common-prefix (strings-common-prefix completions)) + (prefix (to-complete-prefix to-complete))) (debug-message "common-prefix is" common-prefix) - (if (<= (string-length common-prefix) - (string-length (to-complete-prefix to-complete))) - (list #f completions cursor-index to-complete parsed) + (if (> (string-length common-prefix) + (if prefix + (string-length prefix) + 0)) (call-with-values (lambda () (unparse-command-line @@ -155,7 +157,8 @@ (display common-prefix)))) (lambda (completed-line cursor-index) (list completed-line '() - cursor-index to-complete parsed)))))))))))) + cursor-index to-complete parsed))) + (list #f completions cursor-index to-complete parsed)))))))))) (define (strings-common-prefix strs)