Skip to content

Commit

Permalink
Add consult-crm-map: See #353
Browse files Browse the repository at this point in the history
  • Loading branch information
minad committed Jul 26, 2021
1 parent eddc6d3 commit 2d1bed5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion consult.el
Original file line number Diff line number Diff line change
Expand Up @@ -1621,6 +1621,9 @@ ARGS is a list of `make-process' properties and transforms."
map)
"Keymap added for commands with asynchronous candidates.")

(defvar consult-crm-map (make-sparse-keymap)
"Keymap added by `consult-completing-read-multiple'.")

(defvar consult-preview-map (make-sparse-keymap)
"Keymap added for commands with preview.")

Expand Down Expand Up @@ -2308,7 +2311,8 @@ See `completing-read-multiple' for the documentation of the arguments."
(when-let (pos (string-match-p "\\(?: (default[^)]+)\\)?: \\'" prompt))
(setq overlay (make-overlay (+ (point-min) pos) (+ (point-min) (length prompt))))
(when selected
(overlay-put overlay 'display (format " (%s selected): " (length selected))))))
(overlay-put overlay 'display (format " (%s selected): " (length selected)))))
(use-local-map (make-composed-keymap (list consult-crm-map) (current-local-map))))
(unwind-protect
(progn
(add-hook 'pre-command-hook hook 90)
Expand Down

0 comments on commit 2d1bed5

Please sign in to comment.