[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 8c7a7fc 028/348: When reading file names, check preselect
From: |
Oleh Krehel |
Subject: |
[elpa] master 8c7a7fc 028/348: When reading file names, check preselect and initial-input compat |
Date: |
Sat, 8 Apr 2017 11:03:17 -0400 (EDT) |
branch: master
commit 8c7a7fc54053ce4d1b57df22f2f552fda0a37dd9
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
When reading file names, check preselect and initial-input compat
* ivy.el (ivy--reset-state): Prefer the directory of `initial-input',
rather than the directory of `preselect'.
Re #514
---
ivy.el | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/ivy.el b/ivy.el
index 8e03cc1..865a936 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1451,13 +1451,16 @@ This is useful for recursive `ivy-read'."
(require 'dired)
(when preselect
(let ((preselect-directory (file-name-directory preselect)))
- (unless (or (null preselect-directory)
- (string= preselect-directory
- default-directory))
- (setq ivy--directory preselect-directory))
- (setf
- (ivy-state-preselect state)
- (setq preselect (file-name-nondirectory preselect)))))
+ (if (not (equal (expand-file-name preselect-directory)
+ (expand-file-name ivy--directory)))
+ (setf (ivy-state-preselect state) (setq preselect nil))
+ (unless (or (null preselect-directory)
+ (string= preselect-directory
+ default-directory))
+ (setq ivy--directory preselect-directory))
+ (setf
+ (ivy-state-preselect state)
+ (setq preselect (file-name-nondirectory preselect))))))
(setq coll (ivy--sorted-files ivy--directory))
(when initial-input
(unless (or require-match
- [elpa] master cba67e4 038/348: counsel.el (counsel-bookmark): Add require, (continued)
- [elpa] master cba67e4 038/348: counsel.el (counsel-bookmark): Add require, Oleh Krehel, 2017/04/08
- [elpa] master 3d48093 027/348: counsel.el (counsel--gg-sentinel): Add a work around, Oleh Krehel, 2017/04/08
- [elpa] master ddb4681 025/348: counsel.el (counsel-git-grep-cmd-default): New defvar, Oleh Krehel, 2017/04/08
- [elpa] master cf38ceb 040/348: swiper.el (swiper-font-lock-exclude): Add forth-mode, Oleh Krehel, 2017/04/08
- [elpa] master ab55e03 055/348: counsel.el (counsel-set-variable): Add :preselect, Oleh Krehel, 2017/04/08
- [elpa] master f4ec789 056/348: counsel.el (counsel-set-variable): Fix 2nd preselect, Oleh Krehel, 2017/04/08
- [elpa] master 792b7b7 051/348: counsel.el (counsel-set-variable): New command, Oleh Krehel, 2017/04/08
- [elpa] master dc4a858 060/348: counsel.el (counsel-hydra-heads): New command, Oleh Krehel, 2017/04/08
- [elpa] master cd8a570 062/348: Escape `%` chars if present in the symbol value, Oleh Krehel, 2017/04/08
- [elpa] master 97cf30d 063/348: Add multiple-cursors support to ivy-completion-in-region-action, Oleh Krehel, 2017/04/08
- [elpa] master 8c7a7fc 028/348: When reading file names, check preselect and initial-input compat,
Oleh Krehel <=
- [elpa] master 5d0fec1 032/348: ivy.el: Fix some checkdoc warnings, Oleh Krehel, 2017/04/08
- [elpa] master 2e1cebc 036/348: counsel.el (counsel-bookmark): Add, Oleh Krehel, 2017/04/08
- [elpa] master a566403 044/348: ivy.el (ivy-read): Document all args, Oleh Krehel, 2017/04/08
- [elpa] master baf89c0 054/348: ivy-test.el (colir-color-parse): Add test, Oleh Krehel, 2017/04/08
- [elpa] master be24b57 049/348: Revert "ivy.el (ivy-completion-in-region): Fix double insert bug", Oleh Krehel, 2017/04/08
- [elpa] master 77fb030 052/348: ivy.el (ivy-completion-in-region): Fix common length longer than str, Oleh Krehel, 2017/04/08
- [elpa] master 7280e19 050/348: ivy.el (ivy-completion-common-length): Fix double insert bug, Oleh Krehel, 2017/04/08
- [elpa] master 288723e 065/348: counsel.el (counsel-set-variable): Allow new symbols, Oleh Krehel, 2017/04/08
- [elpa] master fe32959 066/348: ivy.el (ivy--actionp): Fix lambda being considered a list of actions, Oleh Krehel, 2017/04/08
- [elpa] master b3cca57 057/348: Make ivy prompt face overriding modular, Oleh Krehel, 2017/04/08