Take care of completions that do *not* alter the command line
This commit is contained in:
parent
41ac17dbe6
commit
07555260e1
|
@ -144,13 +144,16 @@
|
||||||
(list completed-line '() cursor-index to-complete parsed))))
|
(list completed-line '() cursor-index to-complete parsed))))
|
||||||
(else
|
(else
|
||||||
(let ((common-prefix (strings-common-prefix completions)))
|
(let ((common-prefix (strings-common-prefix completions)))
|
||||||
|
(debug-message "common-prefix is" common-prefix)
|
||||||
|
(if (string=? common-prefix "")
|
||||||
|
(list #f completions cursor-index to-complete parsed)
|
||||||
(call-with-values
|
(call-with-values
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(unparse-command-line
|
(unparse-command-line
|
||||||
parsed (lambda (to-complete)
|
parsed (lambda (to-complete)
|
||||||
(display common-prefix))))
|
(display common-prefix))))
|
||||||
(lambda (completed-line cursor-index)
|
(lambda (completed-line cursor-index)
|
||||||
(list completed-line completions cursor-index to-complete parsed)))))))))))
|
(list completed-line completions cursor-index to-complete parsed))))))))))))
|
||||||
|
|
||||||
|
|
||||||
(define (strings-common-prefix strs)
|
(define (strings-common-prefix strs)
|
||||||
|
|
|
@ -738,14 +738,16 @@
|
||||||
;; #### beep or so
|
;; #### beep or so
|
||||||
#f)
|
#f)
|
||||||
(destructure
|
(destructure
|
||||||
(((completed-line completions cursor-index to-complete cmdln) completion-info))
|
(((maybe-completed-line completions cursor-index to-complete cmdln) completion-info))
|
||||||
|
|
||||||
|
(if maybe-completed-line
|
||||||
|
;; #### don't ask about the 2...
|
||||||
|
(display-completed-line maybe-completed-line (+ 2 cursor-index)))
|
||||||
|
|
||||||
(cond
|
(cond
|
||||||
((null? completions)
|
((null? completions)
|
||||||
;; #### don't ask
|
|
||||||
(display-completed-line completed-line (+ 2 cursor-index))
|
|
||||||
#f)
|
#f)
|
||||||
((list? completions)
|
((list? completions)
|
||||||
(display-completed-line completed-line (+ 2 cursor-index))
|
|
||||||
(let* ((select-list
|
(let* ((select-list
|
||||||
(completions->select-list
|
(completions->select-list
|
||||||
completions
|
completions
|
||||||
|
|
Loading…
Reference in New Issue