[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 582c9d4 014/184: swiper.el (swiper--candidates): Don't sto
From: |
Oleh Krehel |
Subject: |
[elpa] master 582c9d4 014/184: swiper.el (swiper--candidates): Don't store line number as a string |
Date: |
Wed, 16 Oct 2019 13:14:40 -0400 (EDT) |
branch: master
commit 582c9d4bf118f58e424ada5f4c69da7128757564
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
swiper.el (swiper--candidates): Don't store line number as a string
---
ivy.el | 4 ++--
swiper.el | 20 ++++++++------------
2 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/ivy.el b/ivy.el
index d580167..2bf0b2d 100644
--- a/ivy.el
+++ b/ivy.el
@@ -3452,7 +3452,7 @@ CANDS are the current candidates."
(res 0)
(i 0))
(dolist (c cands)
- (when (eq n (read (get-text-property 0 'swiper-line-number c)))
+ (when (eq n (get-text-property 0 'swiper-line-number c))
(setq res i))
(cl-incf i))
res))))
@@ -3463,7 +3463,7 @@ CANDS are the current candidates."
CANDS are the current candidates."
(let ((idx (ivy-recompute-index-swiper re-str cands)))
(if (or (= idx -1)
- (<= (read (get-text-property 0 'swiper-line-number (nth idx
cands)))
+ (<= (get-text-property 0 'swiper-line-number (nth idx cands))
(line-number-at-pos)))
idx
(- idx 1))))
diff --git a/swiper.el b/swiper.el
index 5071cec..b437b2d 100644
--- a/swiper.el
+++ b/swiper.el
@@ -528,7 +528,7 @@ numbers; replaces calculating the width from buffer line
count."
(put-text-property
0 1 'display line-number-str str))
(put-text-property
- 0 1 'swiper-line-number line-number-str str))
+ 0 1 'swiper-line-number line-number str))
(push str candidates)))
(funcall advancer 1)
(cl-incf line-number))
@@ -604,10 +604,9 @@ such as `scroll-conservatively' are set to a high value.")
(if (eq (ivy-state-caller ivy-last) 'swiper-isearch)
(swiper--isearch-occur-cands cands)
(mapcar (lambda (s)
- (let ((l (get-text-property 0 'swiper-line-number
s)))
- (setq s (substring s 1))
- (put-text-property 0 1 'swiper-line-number l s)
- (cons (read l) s)))
+ (cons
+ (get-text-property 0 'swiper-line-number s)
+ s))
cands)))
(offset (+ (length fname) 2)))
(mapcar (lambda (x)
@@ -776,7 +775,7 @@ When non-nil, INITIAL-INPUT is the initial search pattern."
(if initial-input
(cl-position-if
(lambda (x)
- (= (1+ preselect) (read (get-text-property 0
'swiper-line-number x))))
+ (= (1+ preselect) (get-text-property 0
'swiper-line-number x)))
(progn
(setq ivy--old-re nil)
(ivy--filter initial-input candidates)))
@@ -904,10 +903,7 @@ the face, window and priority of the overlay."
(let* ((re (replace-regexp-in-string
" " "\t"
re))
- (str (get-text-property 0 'swiper-line-number
(ivy-state-current ivy-last)))
- (num (if (string-match "^[0-9]+" str)
- (string-to-number (match-string 0 str))
- 0)))
+ (num (get-text-property 0 'swiper-line-number
(ivy-state-current ivy-last))))
(unless (memq this-command '(ivy-yank-word
ivy-yank-symbol
ivy-yank-char
@@ -1034,7 +1030,7 @@ WND, when specified is the window."
(defun swiper--action (x)
"Goto line X."
- (let ((ln (1- (read (get-text-property 0 'swiper-line-number x))))
+ (let ((ln (1- (get-text-property 0 'swiper-line-number x)))
(re (ivy--regex ivy-text)))
(if (null x)
(user-error "No candidates")
@@ -1146,7 +1142,7 @@ otherwise continue prompting for buffers."
(with-ivy-window
(switch-to-buffer buffer-name)
(goto-char (point-min))
- (forward-line (1- (read (get-text-property 0 'swiper-line-number
x))))
+ (forward-line (1- (get-text-property 0 'swiper-line-number x)))
(re-search-forward
(ivy--regex ivy-text)
(line-end-position) t)
- [elpa] master 941d408 086/184: doc/ivy.org: Fix "C-M-n" description, (continued)
- [elpa] master 941d408 086/184: doc/ivy.org: Fix "C-M-n" description, Oleh Krehel, 2019/10/16
- [elpa] master 4e9aaec 092/184: ivy-test: Fix tests using file names on Windows, Oleh Krehel, 2019/10/16
- [elpa] master 139816a 106/184: counsel.el (counsel-mark-ring): Add the latest mark to selection, Oleh Krehel, 2019/10/16
- [elpa] master 9592cba 101/184: ivy-hydra.el: Use ivy-read-action-by-key in hydra-ivy, Oleh Krehel, 2019/10/16
- [elpa] master 79333e9 099/184: counsel.el (counsel-fonts): Add, Oleh Krehel, 2019/10/16
- [elpa] master 89deb75 096/184: counsel.el (counsel-rg): When in dired, operate on marked files, Oleh Krehel, 2019/10/16
- [elpa] master 4cddec4 102/184: Respect counsel-describe-function-function from counsel-M-x, Oleh Krehel, 2019/10/16
- [elpa] master 42fedf5 116/184: counsel.el (counsel-file-stale-p): Extract, Oleh Krehel, 2019/10/16
- [elpa] master 0895c1a 113/184: Add key binding to allow switching directory in counsel-git-grep, Oleh Krehel, 2019/10/16
- [elpa] master d27eb38 119/184: counsel.el (counsel-git-grep): Change args order so counsel-cd works, Oleh Krehel, 2019/10/16
- [elpa] master 582c9d4 014/184: swiper.el (swiper--candidates): Don't store line number as a string,
Oleh Krehel <=
- [elpa] master 4a44c9e 018/184: counsel.el (counsel--async-last-error-string): Add for ease of debugging, Oleh Krehel, 2019/10/16
- [elpa] master 5e79f16 020/184: ivy.el (ivy--input): Fix point moving in TRAMP sessions, Oleh Krehel, 2019/10/16
- [elpa] master f30c6e1 022/184: swiper.el: Fix overlay faces using regex-ignore-order, Oleh Krehel, 2019/10/16
- [elpa] master 9c4cdb7 025/184: swiper.el (swiper-isearch-action): Fix for ivy-occur, Oleh Krehel, 2019/10/16
- [elpa] master ed1ba4e 028/184: Makefile (deps): Add target, Oleh Krehel, 2019/10/16
- [elpa] master b5e869e 026/184: swiper.el (swiper--occur-cands): Fix wgrep, Oleh Krehel, 2019/10/16
- [elpa] master 6928beb 031/184: ivy-test.el (ivy-read-file-name-in-buffer-visiting-file): Passes, Oleh Krehel, 2019/10/16
- [elpa] master 35415e3 027/184: ivy-test.el (ivy-swiper-wgrep): Add test, Oleh Krehel, 2019/10/16
- [elpa] master fb78c3f 045/184: swiper.el: Run ispell-comments-and-strings, Oleh Krehel, 2019/10/16
- [elpa] master ae3576a 037/184: swiper.el (swiper-isearch): Fix scroll on RET, Oleh Krehel, 2019/10/16