Skip to content

Commit

Permalink
Set active flag as early as possible
Browse files Browse the repository at this point in the history
  • Loading branch information
clemera committed Jan 25, 2021
1 parent 2cbdd23 commit 257224b
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions selectrum.el
Original file line number Diff line number Diff line change
Expand Up @@ -2050,16 +2050,22 @@ semantics of `cl-defun'."
(buf (current-buffer))
(res
(minibuffer-with-setup-hook
(:append (lambda ()
(selectrum--minibuffer-setup-hook
candidates
(or (car-safe minibuffer-default)
minibuffer-default
default-candidate)
buf)))
(read-from-minibuffer
prompt initial-input selectrum-minibuffer-map nil
(or history 'minibuffer-history) default-candidate))))
(lambda ()
;; Already set the active flag as early as possible
;; so client setup hooks can use it to detect if
;; they are running in a Selectrum session.
(setq-local selectrum-active-p t))
(minibuffer-with-setup-hook
(:append (lambda ()
(selectrum--minibuffer-setup-hook
candidates
(or (car-safe minibuffer-default)
minibuffer-default
default-candidate)
buf)))
(read-from-minibuffer
prompt initial-input selectrum-minibuffer-map nil
(or history 'minibuffer-history) default-candidate)))))
(cond (minibuffer-completion-table
;; Behave like completing-read-default which strips the
;; text properties but leaves the default unchanged
Expand Down

0 comments on commit 257224b

Please sign in to comment.