branch: master commit cdb2b1ae6145e76b1c5b0f7a099ccabc653bb719 Author: Kaushal Modi <kaushal.m...@gmail.com> Commit: Kaushal Modi <kaushal.m...@gmail.com>
Fix the case where file name can contain ~ - 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 | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ivy.el b/ivy.el index 55a23e9..41e38b5 100644 --- 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)