]> code.delx.au - gnu-emacs-elpa/commitdiff
Fix the case where file name can contain ~
authorKaushal Modi <kaushal.modi@gmail.com>
Fri, 19 Jun 2015 18:52:33 +0000 (14:52 -0400)
committerKaushal Modi <kaushal.modi@gmail.com>
Fri, 19 Jun 2015 18:52:33 +0000 (14:52 -0400)
- The fix make opening files like init.el~ now possible. Earlier,
  hitting that last ~ char switch the dir to ~/
- This commit will now make that cd to ~/ only if ~ is the first char in
  the search term

ivy.el

diff --git a/ivy.el b/ivy.el
index 55a23e9040ce0166e9cb033e1c248079fff13044..41e38b553d814f05f6b3814a461bc0e7991f89a4 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -1158,7 +1158,7 @@ Should be run via minibuffer `post-command-hook'."
                   (let ((drive-root (match-string 0 ivy-text)))
                     (when (file-exists-p drive-root)
                       (ivy--cd drive-root)))))
-             (if (string-match "~\\'" ivy-text)
+             (if (string-match "\\`~\\'" ivy-text)
                  (ivy--cd (expand-file-name "~/")))))
           ((eq (ivy-state-collection ivy-last) 'internal-complete-buffer)
            (when (or (and (string-match "\\` " ivy-text)