]> code.delx.au - gnu-emacs-elpa/commitdiff
Correctly expand the file name at point
authorIan Dunn <scholar42@gmail.com>
Fri, 11 Mar 2016 18:46:57 +0000 (13:46 -0500)
committerOleh Krehel <ohwoeowho@gmail.com>
Fri, 11 Mar 2016 19:16:08 +0000 (20:16 +0100)
* counsel.el (counsel-find-file): Use expand-file-name after getting a
  file name at point.

Fixes #430

counsel.el

index 935a0d5b3d077c9ee304e29efd925c2f740a73d4..96e82f83cc0e829ca311dc73bbdccd237db3bfc0 100644 (file)
@@ -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))