branch: externals/vertico commit ad7438f18b22590e8161fe9d600e16feb2637de0 Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
Add vertico--remote-p, check default-directory (Fix #48) --- vertico.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vertico.el b/vertico.el index 8f95473..1b39b01 100644 --- a/vertico.el +++ b/vertico.el @@ -310,13 +310,17 @@ (setcdr (cdar group-list) (caadr group-list)) ;; Link groups (setq group-list (cdr group-list))))))) +(defun vertico--remote-p (path) + "Return t if PATH is a remote path." + (string-match-p "\\`/[^/|:]+:" (substitute-in-file-name path))) + (defun vertico--update-candidates (pt content bounds metadata) "Preprocess candidates given PT, CONTENT, BOUNDS and METADATA." (pcase ;; If Tramp is used, do not compute the candidates in an interruptible fashion, ;; since this will break the Tramp password and user name prompts (See #23). (if (and (eq 'file (completion-metadata-get metadata 'category)) - (string-match-p "\\`/[^/|:]+:" (substitute-in-file-name content))) + (or (vertico--remote-p content) (vertico--remote-p default-directory))) (vertico--recompute-candidates pt content bounds metadata) ;; bug#38024: Icomplete uses `while-no-input-ignore-events' to repair updating issues (let ((while-no-input-ignore-events '(selection-request))