branch: externals/consult commit a8556966c42ba3d6b7d5e7a90089e9e4764b0eb0 Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
consult-async: Disable TAB completion for all UIs (General fix for #164) TAB completion inserts the current candidate, this is undesired with async completion, since the async process will be restarted. --- consult-selectrum.el | 1 + consult-vertico.el | 1 + consult.el | 14 ++++++-------- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/consult-selectrum.el b/consult-selectrum.el index 108391a..098a5ef 100644 --- a/consult-selectrum.el +++ b/consult-selectrum.el @@ -93,6 +93,7 @@ SPLIT is the splitter function." (add-hook 'consult--crm-setup-hook #'consult-selectrum--crm-setup) (advice-add #'consult--completion-filter :around #'consult-selectrum--filter-adv) (advice-add #'consult--split-setup :around #'consult-selectrum--split-setup-adv) +(define-key consult-async-map [remap selectrum-insert-current-candidate] #'selectrum-next-page) (provide 'consult-selectrum) ;;; consult-selectrum.el ends here diff --git a/consult-vertico.el b/consult-vertico.el index 61b00c4..b8945d9 100644 --- a/consult-vertico.el +++ b/consult-vertico.el @@ -48,6 +48,7 @@ (add-hook 'consult--completion-candidate-hook #'consult-vertico--candidate) (add-hook 'consult--completion-refresh-hook #'consult-vertico--refresh) +(define-key consult-async-map [remap vertico-insert] #'vertico-next-group) (provide 'consult-vertico) ;;; consult-vertico.el ends here diff --git a/consult.el b/consult.el index b8c0e9c..c107d5c 100644 --- a/consult.el +++ b/consult.el @@ -1590,7 +1590,12 @@ ARGS is a list of `make-process' properties and transforms." ;;;; Special keymaps -(defvar consult-async-map (make-sparse-keymap) +(defvar consult-async-map + (let ((map (make-sparse-keymap))) + ;; Async keys overwriting some unusable defaults for the default completion + (define-key map [remap minibuffer-complete-word] #'self-insert-command) + (define-key map [remap minibuffer-complete] #'minibuffer-completion-help) + map) "Keymap added for commands with asynchronous candidates.") (defvar consult-preview-map (make-sparse-keymap) @@ -1638,13 +1643,6 @@ PREVIEW-KEY are the preview keys." (let ((old-map (current-local-map)) (map (make-sparse-keymap))) - ;; Async keys overwriting some unusable defaults for the default completion - (when async - (when (eq (lookup-key old-map " ") #'minibuffer-complete-word) - (define-key map " " #'self-insert-command)) - (when (eq (lookup-key old-map "\t") #'minibuffer-complete) - (define-key map "\t" #'minibuffer-completion-help))) - ;; Add narrow keys (when narrow (consult--narrow-setup narrow map))