branch: elpa/helm
commit 8a328fb1321e2fe83c3c3e618047b6c7ca69d068
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>

    Fix default in CR with emacs style
---
 helm-mode.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/helm-mode.el b/helm-mode.el
index ac68e4031c..7abad0937d 100644
--- a/helm-mode.el
+++ b/helm-mode.el
@@ -1563,9 +1563,13 @@ This handler uses dynamic matching which allows 
honouring `completion-styles'."
          :history history
          :nomark (null helm-comp-read-use-marked)
          :reverse-history helm-mode-reverse-history
-         ;; In helm h-c-styles default is passed directly in
-         ;; candidates.
-         :default (and (eq helm-completion-style 'emacs) (null afix) default)
+         ;; If DEF is not provided, fallback to empty string
+         ;; to avoid `thing-at-point' to be appended on top of list.
+         ;; FIXME: default is added first in the collection fn, and then it is
+         ;; added here and appended to candidates with the get candidates fn of
+         ;; helm-comp-read, later when sorting default may move somewhere
+         ;; whereas it has to stay on top.
+         :default (or default "")
          :fc-transformer
          (append (and (or afix afun (memq category '(file library)))
                       (list (lambda (candidates source)

Reply via email to