[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master f9ef307 072/167: Improve the preselect index in ivy-resume
From: |
Oleh Krehel |
Subject: |
[elpa] master f9ef307 072/167: Improve the preselect index in ivy-resume |
Date: |
Tue, 08 Dec 2015 10:49:58 +0000 |
branch: master
commit f9ef307eea5d1e7fe2cf0fb1503e9bc3e4cac0d4
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Improve the preselect index in ivy-resume
* ivy.el (ivy--recompute-index): Don't change the ivy--index that was
set in `ivy--reset-state' by `ivy-resume'.
With this, it's possible to e.g. "<f1> f", enter "for", navigate to
"format" and press "C-g". Calling `ivy-resume' will point to "format"
still.
---
ivy.el | 39 ++++++++++++++++++++-------------------
1 files changed, 20 insertions(+), 19 deletions(-)
diff --git a/ivy.el b/ivy.el
index 3ae9abc..162cd2e 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1662,25 +1662,26 @@ CANDIDATES are assumed to be static."
(func (or (and caller (cdr (assoc caller ivy-index-functions-alist)))
(cdr (assoc t ivy-index-functions-alist))
#'ivy-recompute-index-zero)))
- (setq ivy--index
- (or
- (cl-position (if (and (> (length re-str) 0)
- (eq ?^ (aref re-str 0)))
- (substring re-str 1)
- re-str) cands
- :test #'equal)
- (and ivy--directory
- (cl-position
- (concat re-str "/") cands
- :test #'equal))
- (and (not (string= name ""))
- (not (and (require 'flx nil 'noerror)
- (eq ivy--regex-function 'ivy--regex-fuzzy)
- (< (length cands) 200)))
-
- (cl-position (nth ivy--index ivy--old-cands)
- cands))
- (funcall func re-str cands)))
+ (unless (eq this-command 'ivy-resume)
+ (setq ivy--index
+ (or
+ (cl-position (if (and (> (length re-str) 0)
+ (eq ?^ (aref re-str 0)))
+ (substring re-str 1)
+ re-str) cands
+ :test #'equal)
+ (and ivy--directory
+ (cl-position
+ (concat re-str "/") cands
+ :test #'equal))
+ (and (not (string= name ""))
+ (not (and (require 'flx nil 'noerror)
+ (eq ivy--regex-function 'ivy--regex-fuzzy)
+ (< (length cands) 200)))
+
+ (cl-position (nth ivy--index ivy--old-cands)
+ cands))
+ (funcall func re-str cands))))
(when (and (or (string= name "")
(string= name "^"))
(not (equal ivy--old-re "")))
- [elpa] master fd19ab1 062/167: Add a test for the perfect match logic, (continued)
- [elpa] master fd19ab1 062/167: Add a test for the perfect match logic, Oleh Krehel, 2015/12/08
- [elpa] master 2386277 060/167: ivy.el (ivy-resume): Pass caller, Oleh Krehel, 2015/12/08
- [elpa] master 607fd1f 061/167: Bring back the lost perfect match logic, Oleh Krehel, 2015/12/08
- [elpa] master f0acebd 063/167: Fix Custom menus, Oleh Krehel, 2015/12/08
- [elpa] master f6dd9cd 066/167: ivy.el (ivy-alt-done): Fix up last commit, Oleh Krehel, 2015/12/08
- [elpa] master a11c978 068/167: ivy-immediate-done should use ivy--directory, Oleh Krehel, 2015/12/08
- [elpa] master d8673f8 078/167: ivy.el (ffap): Move require, Oleh Krehel, 2015/12/08
- [elpa] master 47f53b6 073/167: counsel.el (counsel--find-symbol): Resolve name clash better, Oleh Krehel, 2015/12/08
- [elpa] master dc84ba3 070/167: Rename and move the minibuffer faces, Oleh Krehel, 2015/12/08
- [elpa] master 183b803 071/167: Use a specific blending method for dark themes, Oleh Krehel, 2015/12/08
- [elpa] master f9ef307 072/167: Improve the preselect index in ivy-resume,
Oleh Krehel <=
- [elpa] master 576563d 082/167: ivy.el (with-ivy-window): Ensure window is live, Oleh Krehel, 2015/12/08
- [elpa] master f60d10e 075/167: "C-x C-f M-n" can call ffap-url-fetcher when at URL, Oleh Krehel, 2015/12/08
- [elpa] master bd93a0f 081/167: ivy.el (ivy-state): Add a new field BUFFER, Oleh Krehel, 2015/12/08
- [elpa] master 202546b 080/167: swiper.el (swiper-mc): Update, Oleh Krehel, 2015/12/08
- [elpa] master f00696a 056/167: ivy.el (ivy-extra-directories): Improve :type, Oleh Krehel, 2015/12/08
- [elpa] master e338785 057/167: ivy.el (ivy-sort-functions-alist): Upgrade to defcustom, Oleh Krehel, 2015/12/08
- [elpa] master 71695df 065/167: "C-j" should not stop completion for a pasted file path, Oleh Krehel, 2015/12/08
- [elpa] master dfd6204 064/167: Fix pasting file paths on Windows, Oleh Krehel, 2015/12/08
- [elpa] master 1af25f6 067/167: swiper.el (swiper-font-lock-ensure): Amend exception list, Oleh Krehel, 2015/12/08
- [elpa] master 5f22310 069/167: counsel.el (counsel-git): Update default-directory, Oleh Krehel, 2015/12/08