1
0
Fork 0

- [gemini] complete URL on command line matching substring in any position, not only at the start of the URL.

This commit is contained in:
cage 2021-02-10 20:34:08 +01:00
parent 29ccc502db
commit 07d04f760a
1 changed files with 6 additions and 1 deletions

View File

@ -102,6 +102,11 @@ completed) and the common prefix of the completion string."
(lambda (a)
(text-utils:string-starts-with-p hint a)))
(defun contains-clsr (hint)
(let ((scanner (cl-ppcre:create-scanner hint)))
(lambda (a)
(cl-ppcre:scan scanner a))))
(defun remove-if-hidden (candidates)
(remove-if #'db:hidden-recipient-p candidates))
@ -173,7 +178,7 @@ list af all possible candidtae for completion."
(defun make-complete-gemini-iri-fn (prompt)
(lambda (hint)
(when-let ((matched (remove-if-not (starts-with-clsr hint)
(when-let ((matched (remove-if-not (contains-clsr hint)
(remove-duplicates (funcall #'db:history-prompt->values
prompt)
:test #'string=))))