branch: master
commit d4253924a7b78f150111645831165239509a4a76
Author: Ian Dunn <schola...@gmail.com>
Commit: Oleh Krehel <ohwoeo...@gmail.com>

    Correctly expand the file name at point
    
    * counsel.el (counsel-find-file): Use expand-file-name after getting a
      file name at point.
    
    Fixes #430
---
 counsel.el |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/counsel.el b/counsel.el
index 935a0d5..96e82f8 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1114,7 +1114,8 @@ When INITIAL-INPUT is non-nil, use it in the minibuffer 
during completion."
                 (find-file (expand-file-name x ivy--directory))))
             :preselect (when counsel-find-file-at-point
                          (require 'ffap)
-                         (ffap-guesser))
+                         (let ((f (ffap-guesser)))
+                           (when f (expand-file-name f))))
             :require-match 'confirm-after-completion
             :history 'file-name-history
             :keymap counsel-find-file-map))

Reply via email to