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