[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 8312176 210/348: ivy.el (ivy-magic-tilde): New defcustom
From: |
Oleh Krehel |
Subject: |
[elpa] master 8312176 210/348: ivy.el (ivy-magic-tilde): New defcustom |
Date: |
Sat, 8 Apr 2017 11:03:58 -0400 (EDT) |
branch: master
commit 83121769b411a49d1e58aab89e8c800810b223c0
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el (ivy-magic-tilde): New defcustom
Decide if "~" or "~/" should cd home.
* ivy.el (ivy--exhibit): Update.
Fixes #687
Fixes #679
---
ivy.el | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/ivy.el b/ivy.el
index 42cef6f..3dbf887 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2196,6 +2196,11 @@ If SUBEXP is nil, the text properties are applied to the
whole match."
(file-exists-p ivy--current))))
(ivy--cd (expand-file-name ivy--current ivy--directory)))))
+(defcustom ivy-magic-tilde t
+ "When non-nil, ~ will move home when selecting files.
+Otherwise, ~/ will move home."
+ :type boolean)
+
(defun ivy--exhibit ()
"Insert Ivy completions display.
Should be run via minibuffer `post-command-hook'."
@@ -2217,10 +2222,12 @@ Should be run via minibuffer `post-command-hook'."
(ivy--insert-minibuffer
(ivy--format ivy--all-candidates))))
(cond (ivy--directory
- (if (string-match "/\\'" ivy-text)
- (ivy--magic-file-slash)
- (if (string-match "\\`~\\'" ivy-text)
- (ivy--cd (expand-file-name "~/")))))
+ (cond ((or (string= "~/" ivy-text)
+ (and (string= "~" ivy-text)
+ ivy-magic-tilde))
+ (ivy--cd (expand-file-name "~/")))
+ ((string-match "/\\'" ivy-text)
+ (ivy--magic-file-slash))))
((eq (ivy-state-collection ivy-last) 'internal-complete-buffer)
(when (or (and (string-match "\\` " ivy-text)
(not (string-match "\\` " ivy--old-text)))
- [elpa] master 77ebfdb 196/348: Makefile: load ivy-overlay.el, (continued)
- [elpa] master 77ebfdb 196/348: Makefile: load ivy-overlay.el, Oleh Krehel, 2017/04/08
- [elpa] master f357cd2 198/348: ivy-overlay.el (ivy-overlay-cleanup): Restore cursor-type, Oleh Krehel, 2017/04/08
- [elpa] master f8d78eb 197/348: Add a fake cursor to inline completion display, Oleh Krehel, 2017/04/08
- [elpa] master 1bdc50b 200/348: ivy-overlay.el (ivy-overlay-cleanup): Don't trigger company, Oleh Krehel, 2017/04/08
- [elpa] master bfddbc2 199/348: ivy-overlay.el (ivy-display-function-overlay): Fix up, Oleh Krehel, 2017/04/08
- [elpa] master d1de20f 193/348: Display completion-at-point at point, Oleh Krehel, 2017/04/08
- [elpa] master 8109655 204/348: ivy-overlay.el (ivy-display-function-overlay): Fix with-ivy-window, Oleh Krehel, 2017/04/08
- [elpa] master 572c2aa 206/348: Enable read-only-mode for ivy-occur, Oleh Krehel, 2017/04/08
- [elpa] master 73d23d1 207/348: Correct a minor doc error: `info-describe-symbol' should be `info-lookup-symbol'., Oleh Krehel, 2017/04/08
- [elpa] master 378943c 212/348: ivy.el (ivy--minibuffer-setup): Fixup max-mini-window-height, Oleh Krehel, 2017/04/08
- [elpa] master 8312176 210/348: ivy.el (ivy-magic-tilde): New defcustom,
Oleh Krehel <=
- [elpa] master dcec964 211/348: ivy.el (ivy-magic-tilde): Fix type, Oleh Krehel, 2017/04/08
- [elpa] master 3d600b6 214/348: Correct ivy-fixed-height-minibuffer size, Oleh Krehel, 2017/04/08
- [elpa] master 2d4db96 215/348: Silence byte-compiler, Oleh Krehel, 2017/04/08
- [elpa] master 2f6b67a 221/348: counsel.el (counsel-pt): Add initial-input arg, Oleh Krehel, 2017/04/08
- [elpa] master 085b0f2 218/348: Fix file name completion for when initial-input is a file name, Oleh Krehel, 2017/04/08
- [elpa] master 823d86c 224/348: counsel.el (counsel-grep): Quote :preselect, Oleh Krehel, 2017/04/08
- [elpa] master c8be397 222/348: update 'counsel-bookmark' with the ability to create, edit, and delete bookmarks, Oleh Krehel, 2017/04/08
- [elpa] master 45834cc 231/348: ivy.el (ivy--reset-state): file-name-directory can return nil, Oleh Krehel, 2017/04/08
- [elpa] master aacba19 229/348: ivy.el (ivy--directory-done): Check if ivy-text is a proper dir, Oleh Krehel, 2017/04/08
- [elpa] master b1f587d 233/348: ivy.el (ivy--directory-done): Fix "RET" on no input, Oleh Krehel, 2017/04/08