From c232be69a13ed1959475f156bfae228d156488a8 Mon Sep 17 00:00:00 2001 From: mainzelm Date: Thu, 6 Apr 2006 16:04:38 +0000 Subject: [PATCH] deal with empty prefix when trying to display common prefix --- scheme/completer.scm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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)