[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master c69deb2 179/184: ivy.el: "~~" now works as expected for /s
From: |
Oleh Krehel |
Subject: |
[elpa] master c69deb2 179/184: ivy.el: "~~" now works as expected for /sudo:: |
Date: |
Wed, 16 Oct 2019 13:15:18 -0400 (EDT) |
branch: master
commit c69deb264959ac130ada0a508fc041917ea56c09
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el: "~~" now works as expected for /sudo::
Fixes #2276
---
ivy.el | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/ivy.el b/ivy.el
index 332b394..c125779 100644
--- a/ivy.el
+++ b/ivy.el
@@ -3150,12 +3150,14 @@ Should be run via minibuffer `post-command-hook'."
'ivy--exhibit)))
(ivy--exhibit)))
-(defun ivy--magic-tilde-directory ()
- "Return an appropriate directory for when ~ or ~/ are entered."
+(defun ivy--magic-tilde-directory (dir)
+ "Return an appropriate home for DIR for when ~ or ~/ are entered."
(expand-file-name
(let (remote)
- (if (and (setq remote (file-remote-p ivy--directory))
- (not (string-match-p "/home/\\([^/]+\\)/\\'" (file-local-name
ivy--directory))))
+ (if (and (setq remote (file-remote-p dir))
+ (let ((local (file-local-name dir)))
+ (not (or (string= "/root/" local)
+ (string-match-p "/home/\\([^/]+\\)/\\'" local)))))
(concat remote "~/")
"~/"))))
@@ -3199,7 +3201,7 @@ Should be run via minibuffer `post-command-hook'."
(cond ((or (string= "~/" ivy-text)
(and (string= "~" ivy-text)
ivy-magic-tilde))
- (ivy--cd (ivy--magic-tilde-directory)))
+ (ivy--cd (ivy--magic-tilde-directory ivy--directory)))
((string-match "/\\'" ivy-text)
(ivy--magic-file-slash))))
((eq (ivy-state-collection ivy-last) #'internal-complete-buffer)
- [elpa] master 22cc602 160/184: counsel.el (counsel-find-symbol): Should not show up in counsel-M-x, (continued)
- [elpa] master 22cc602 160/184: counsel.el (counsel-find-symbol): Should not show up in counsel-M-x, Oleh Krehel, 2019/10/16
- [elpa] master b85f857 166/184: .github/FUNDING.yml: Add github, Oleh Krehel, 2019/10/16
- [elpa] master 722250c 162/184: counsel.el (counsel-imenu-action): Handle nil case, Oleh Krehel, 2019/10/16
- [elpa] master 9970ae6 180/184: counsel.el (counsel-read-directory-name): Add, Oleh Krehel, 2019/10/16
- [elpa] master 7054901 176/184: ivy.el (ivy-occur-revert-buffer): Make more generic, Oleh Krehel, 2019/10/16
- [elpa] master fcef913 023/184: swiper-isearch: Fix regexes in "ignore-order" case, Oleh Krehel, 2019/10/16
- [elpa] master 0b85d9d 030/184: counsel.el (counsel-at-git-issue-p): Add vc-git-log-view-mode, Oleh Krehel, 2019/10/16
- [elpa] master 2db2c51 050/184: counsel.el (counsel-find-file-mkdir-action): make parents too, Oleh Krehel, 2019/10/16
- [elpa] master f90bc8c 164/184: ivy.el (ivy-configure): Add :height, Oleh Krehel, 2019/10/16
- [elpa] master 09c40fc 175/184: swiper.el (swiper--occur-insert-lines): Simplify, Oleh Krehel, 2019/10/16
- [elpa] master c69deb2 179/184: ivy.el: "~~" now works as expected for /sudo::,
Oleh Krehel <=
- [elpa] master 24a6354 170/184: ivy.el (ivy--format): Improve docstring, Oleh Krehel, 2019/10/16
- [elpa] master 0d842e3 062/184: ivy.el (ivy-switch-buffer): Clean up, Oleh Krehel, 2019/10/16
- [elpa] master 560957f 074/184: Check if ivy--done is accepting a string., Oleh Krehel, 2019/10/16
- [elpa] master 3b4956a 123/184: counsel.el (counsel-evil-registers-height): Remove obsolete var, Oleh Krehel, 2019/10/16
- [elpa] master a1bb702 128/184: Nicer message when counsel-git-grep finds no match, Oleh Krehel, 2019/10/16
- [elpa] master 5d2938f 126/184: counsel.el (counsel-git-grep): Works with ivy--regex-fuzzy, Oleh Krehel, 2019/10/16
- [elpa] master 3a37741 147/184: swiper.el (swiper--update-input-ivy): Set case-fold-search, Oleh Krehel, 2019/10/16
- [elpa] master dea98fc 153/184: ivy.el (ivy-inhibit-action): Clean up docstring, Oleh Krehel, 2019/10/16
- [elpa] master 92f54f6 150/184: ivy.el (ivy-configure): Add :grep-p, Oleh Krehel, 2019/10/16
- [elpa] master abe5aa8 006/184: ivy.el (ivy-resume): Select original buffer for search functions, Oleh Krehel, 2019/10/16