mirror of https://codeberg.org/cage/tinmop/
- complete in a different way things that looks like local paths when opening gemini address.
- prevented a crash when opening a directory that does not exists on local filesystem.
This commit is contained in:
parent
52bace4301
commit
16733f12ef
|
@ -45,10 +45,11 @@ See: complete:directory-complete")
|
|||
|
||||
(defun underlying-directory-p (pathname)
|
||||
"Find the actual directory of pathname (i.e. resolve file link"
|
||||
(ignore-errors
|
||||
(case (file-kind pathname)
|
||||
(:directory t)
|
||||
(:symbolic-link
|
||||
(file-kind (merge-pathnames (read-link pathname) pathname)))))
|
||||
(file-kind (merge-pathnames (read-link pathname) pathname))))))
|
||||
|
||||
;;; We can't easily do zsh-style tab-completion of ~us into ~user, but
|
||||
;;; at least we can expand ~ and ~user. The other bug here at the
|
||||
|
@ -232,6 +233,10 @@ list af all possible candidtae for completion."
|
|||
|
||||
(defun make-complete-gemini-iri-fn (prompt)
|
||||
(lambda (hint)
|
||||
(if (or (text-utils:string-starts-with-p fs:*directory-sep* hint)
|
||||
(text-utils:string-starts-with-p "." hint)
|
||||
(text-utils:string-starts-with-p "~" hint))
|
||||
(directory-complete hint)
|
||||
(when-let ((bag (remove-duplicates (funcall #'db:history-prompt->values
|
||||
prompt)
|
||||
:test #'string=)))
|
||||
|
@ -247,7 +252,7 @@ list af all possible candidtae for completion."
|
|||
;complete-at-point and
|
||||
;insert-selected-suggestion),
|
||||
|
||||
indices))))))
|
||||
indices)))))))
|
||||
|
||||
(defun complete-chat-message (hint)
|
||||
(append (username-complete hint)
|
||||
|
|
Loading…
Reference in New Issue