[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master ab6561f 321/348: ivy.el: Use set-ivy-index instead of setq
From: |
Oleh Krehel |
Subject: |
[elpa] master ab6561f 321/348: ivy.el: Use set-ivy-index instead of setq ivy--index |
Date: |
Sat, 8 Apr 2017 11:04:23 -0400 (EDT) |
branch: master
commit ab6561f40cb049ce19a27aa8e87c39cf666f73f1
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el: Use set-ivy-index instead of setq ivy--index
---
counsel.el | 7 +++---
ivy.el | 82 +++++++++++++++++++++++++++++++-------------------------------
2 files changed, 45 insertions(+), 44 deletions(-)
diff --git a/counsel.el b/counsel.el
index d154181..a8efe8d 100644
--- a/counsel.el
+++ b/counsel.el
@@ -160,9 +160,10 @@ Or the time of the last minibuffer update.")
(unless (stringp re)
(setq re (caar re)))
(if (null ivy--old-cands)
- (unless (setq ivy--index (ivy--preselect-index
- (ivy-state-preselect ivy-last)
- ivy--all-candidates))
+ (unless (ivy-set-index
+ (ivy--preselect-index
+ (ivy-state-preselect ivy-last)
+ ivy--all-candidates))
(ivy--recompute-index
ivy-text re ivy--all-candidates))
(ivy--recompute-index
diff --git a/ivy.el b/ivy.el
index ad55d7e..5824f43 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1104,7 +1104,7 @@ If so, move to that directory, while keeping only the
file name."
'ivy-index))))
(when idx
(ivy--exhibit)
- (setq ivy--index idx))))
+ (ivy-set-index idx))))
(defun ivy--cd (dir)
"When completing file names, move to directory DIR."
@@ -1112,7 +1112,7 @@ If so, move to that directory, while keeping only the
file name."
(error "Unexpected")
(setq ivy--old-cands nil)
(setq ivy--old-re nil)
- (setq ivy--index 0)
+ (ivy-set-index 0)
(setq ivy--all-candidates
(ivy--sorted-files (setq ivy--directory dir)))
(setq ivy-text "")
@@ -1689,23 +1689,23 @@ This is useful for recursive `ivy-read'."
(setq ivy--old-cands nil)
(when (integerp preselect)
(setq ivy--old-re "")
- (setq ivy--index preselect))
+ (ivy-set-index preselect))
(when initial-input
;; Needed for anchor to work
(setq ivy--old-cands coll)
(setq ivy--old-cands (ivy--filter initial-input coll)))
(setq ivy--all-candidates coll)
(unless (integerp preselect)
- (setq ivy--index (or
- (and dynamic-collection
- ivy--index)
- (and preselect
- (ivy--preselect-index
- preselect
- (if initial-input
- ivy--old-cands
- coll)))
- 0))))
+ (ivy-set-index (or
+ (and dynamic-collection
+ ivy--index)
+ (and preselect
+ (ivy--preselect-index
+ preselect
+ (if initial-input
+ ivy--old-cands
+ coll)))
+ 0))))
(setq ivy-exit nil)
(setq ivy--default
(if (region-active-p)
@@ -2618,35 +2618,35 @@ before substring matches."
(cdr (assoc t ivy-index-functions-alist))
#'ivy-recompute-index-zero)))
(unless (eq this-command 'ivy-resume)
- (setq ivy--index
- (or
- (cl-position (if (and (> (length name) 0)
- (eq ?^ (aref name 0)))
- (substring name 1)
- name) cands
- :test #'equal)
- (and ivy--directory
- (cl-position
- (concat re-str "/") cands
- :test #'equal))
- (and (eq caller 'ivy-switch-buffer)
- (> (length name) 0)
- 0)
- (and (not (string= name ""))
- (not (and ivy--flx-featurep
- (eq ivy--regex-function 'ivy--regex-fuzzy)
- (< (length cands) 200)))
- ivy--old-cands
- (cl-position (nth ivy--index ivy--old-cands)
- cands))
- (funcall func re-str cands))))
+ (ivy-set-index
+ (or
+ (cl-position (if (and (> (length name) 0)
+ (eq ?^ (aref name 0)))
+ (substring name 1)
+ name) cands
+ :test #'equal)
+ (and ivy--directory
+ (cl-position
+ (concat re-str "/") cands
+ :test #'equal))
+ (and (eq caller 'ivy-switch-buffer)
+ (> (length name) 0)
+ 0)
+ (and (not (string= name ""))
+ (not (and ivy--flx-featurep
+ (eq ivy--regex-function 'ivy--regex-fuzzy)
+ (< (length cands) 200)))
+ ivy--old-cands
+ (cl-position (nth ivy--index ivy--old-cands)
+ cands))
+ (funcall func re-str cands))))
(when (or (string= name "")
(string= name "^"))
- (setq ivy--index
- (or (ivy--preselect-index
- (ivy-state-preselect ivy-last)
- cands)
- ivy--index)))))
+ (ivy-set-index
+ (or (ivy--preselect-index
+ (ivy-state-preselect ivy-last)
+ cands)
+ ivy--index)))))
(defun ivy-recompute-index-swiper (_re-str cands)
(condition-case nil
@@ -2941,7 +2941,7 @@ SEPARATOR is used to join the candidates."
CANDS is a list of strings."
(setq ivy--length (length cands))
(when (>= ivy--index ivy--length)
- (setq ivy--index (max (1- ivy--length) 0)))
+ (ivy-set-index (max (1- ivy--length) 0)))
(if (null cands)
(setf (ivy-state-current ivy-last) "")
(let* ((half-height (/ ivy-height 2))
- [elpa] master eddf427 261/348: counsel.el (counsel-ag): Fix byte-compile warning, (continued)
- [elpa] master eddf427 261/348: counsel.el (counsel-ag): Fix byte-compile warning, Oleh Krehel, 2017/04/08
- [elpa] master bb4814a 262/348: Fix counsel-ag support limiting in files, Oleh Krehel, 2017/04/08
- [elpa] master 4232088 265/348: Don't claim `swiper' provides `ivy-mode', Oleh Krehel, 2017/04/08
- [elpa] master ee0d9e3 275/348: ivy.el (ivy--reset-state): Simplify, Oleh Krehel, 2017/04/08
- [elpa] master abdbfa7 273/348: counsel.el: Add counsel-org-agenda-headlines, Oleh Krehel, 2017/04/08
- [elpa] master 482c3e9 279/348: counsel.el (counsel-ace-link): Use `cdr' for action., Oleh Krehel, 2017/04/08
- [elpa] master e4c248a 278/348: doc/ivy.org: Update package names in ELPA/MELPA, Oleh Krehel, 2017/04/08
- [elpa] master 6e6738c 294/348: counsel.el (counsel-git-grep-cmd-default): Use '%s' quoting, Oleh Krehel, 2017/04/08
- [elpa] master d4e5d79 290/348: counsel.el (counsel-package): Fix sorting issue, Oleh Krehel, 2017/04/08
- [elpa] master 15f89f7 295/348: ivy.el (ivy-minibuffer-map): Bind "C-v" and scroll-up-command, Oleh Krehel, 2017/04/08
- [elpa] master ab6561f 321/348: ivy.el: Use set-ivy-index instead of setq ivy--index,
Oleh Krehel <=
- [elpa] master 45383fe 330/348: ivy-overlay.el (ivy-display-function-overlay): Put overlay at symbol start, Oleh Krehel, 2017/04/08
- [elpa] master 1d32ceb 332/348: counsel.el (counsel-irony): New command, Oleh Krehel, 2017/04/08
- [elpa] master ace01d5 347/348: ivy.el (ivy-immediate-done): Fix for rgrep, Oleh Krehel, 2017/04/08
- [elpa] master 2f5bfc0 144/348: counsel.el (counsel-dpkg): New command, Oleh Krehel, 2017/04/08
- [elpa] master d7a1fda 143/348: swiper.el (swiper-all): "M-q" calls query-replace, Oleh Krehel, 2017/04/08
- [elpa] master 5a4ede4 130/348: Fix swiper-all for ivy--regex-ignore-order, Oleh Krehel, 2017/04/08
- [elpa] master 5787780 137/348: Makefile (plain): Print version, Oleh Krehel, 2017/04/08
- [elpa] master 72784c1 149/348: counsel.el (counsel-imenu): Force rescan if requested, Oleh Krehel, 2017/04/08
- [elpa] master 01b0195 306/348: Correct Circe major-modes in ...-font-lock-exclude, Oleh Krehel, 2017/04/08
- [elpa] master 94a466f 341/348: ivy.el: Clean up whitespace, Oleh Krehel, 2017/04/08