fix completion, don't insert absolute file names.
This commit is contained in:
parent
8c9e1bde33
commit
3b140722a4
|
@ -67,20 +67,17 @@
|
|||
file))))))
|
||||
partial-name))
|
||||
|
||||
(define (complete-files/path partial-name)
|
||||
(debug-message "complete-files/path " partial-name)
|
||||
(complete-with-filesystem-objects
|
||||
(lambda (file) file) partial-name))
|
||||
|
||||
;; completion functions for arguments and redirection
|
||||
|
||||
(define (find-completions-for-arg cmd to-complete)
|
||||
(debug-message "find-completions-for-arg " cmd "," to-complete)
|
||||
(let ((prefix (to-complete-prefix to-complete)))
|
||||
(if prefix
|
||||
(complete-files/path (expand-file-name prefix (cwd)))
|
||||
(complete-files/path ""))))
|
||||
(complete-with-filesystem-objects
|
||||
(if prefix
|
||||
(lambda (file)
|
||||
(and (string-prefix? prefix file) file))
|
||||
(lambda (file) file))
|
||||
(or (to-complete-prefix to-complete) (cwd)))))
|
||||
|
||||
;; #### no special treatment yet
|
||||
(define find-completions-for-redir find-completions-for-arg)
|
||||
|
||||
|
|
|
@ -476,7 +476,6 @@
|
|||
complete-with-filesystem-objects
|
||||
make-completer-for-file-with-extension
|
||||
complete-executables/path
|
||||
complete-files/path
|
||||
|
||||
find-completions-for-arg
|
||||
find-completions-for-redir))
|
||||
|
|
|
@ -111,11 +111,11 @@
|
|||
|
||||
(define just-run-in-foreground
|
||||
(lambda (command args)
|
||||
(run/fg (,command ,@args))))
|
||||
(run/fg* `(exec-epf (,command ,@args)))))
|
||||
|
||||
(define just-run-in-background
|
||||
(lambda (command args)
|
||||
(run/bg (,command ,@args))))
|
||||
(run/bg* `(exec-epf (,command ,@args)))))
|
||||
|
||||
;; Parse options for ls command using args-fold (SRFI 37)
|
||||
;; We don't care for options that format the output.
|
||||
|
@ -284,6 +284,5 @@
|
|||
(lambda (command to-complete)
|
||||
(debug-message "ftp completer " command "," to-complete)
|
||||
(completions-for cs (or (to-complete-prefix to-complete) ""))))
|
||||
(lambda (command args)
|
||||
(run/fg (,command ,@args)))))
|
||||
just-run-in-foreground))
|
||||
|
||||
|
|
Loading…
Reference in New Issue