]> code.delx.au - gnu-emacs-elpa/commitdiff
counsel.el (counsel-imenu): Add :preselect
authorOleh Krehel <ohwoeowho@gmail.com>
Fri, 19 Feb 2016 13:32:43 +0000 (14:32 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Fri, 19 Feb 2016 13:32:43 +0000 (14:32 +0100)
Fixes #388

counsel.el

index b3549b181b492a88a3ac2ba4816479f3806325dd..5e5686f3691d24b43ce15038e1a91f89aa6afebd 100644 (file)
@@ -1466,6 +1466,8 @@ PREFIX is used to create the key."
          (items (imenu--make-index-alist t))
          (items (delete (assoc "*Rescan*" items) items)))
     (ivy-read "imenu items:" (counsel-imenu-get-candidates-from items)
+              :preselect (thing-at-point 'symbol)
+              :require-match t
               :action (lambda (candidate)
                         (with-ivy-window
                           ;; In org-mode, (imenu candidate) will expand child node