[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-hydra b9eb3c1 162/395: swiper.el (swiper--line-numb
From: |
Basil L. Contovounesios |
Subject: |
[elpa] externals/ivy-hydra b9eb3c1 162/395: swiper.el (swiper--line-number): Works with ivy-mark |
Date: |
Thu, 25 Feb 2021 08:31:54 -0500 (EST) |
branch: externals/ivy-hydra
commit b9eb3c1eb39f668bbbf8bcac4c0b8a60c7c6c65b
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
swiper.el (swiper--line-number): Works with ivy-mark
Since `ivy-mark' adds one char, the line number property can move.
Fixes #2470
---
swiper.el | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/swiper.el b/swiper.el
index d5cbe6c..8f936f8 100644
--- a/swiper.el
+++ b/swiper.el
@@ -619,7 +619,7 @@ When non-nil, INITIAL-INPUT is the initial search pattern."
(if (eq (ivy-state-caller ivy-last) 'swiper-isearch)
(swiper--isearch-occur-cands cands)
(mapcar (lambda (s)
- (let ((n (get-text-property 0 'swiper-line-number
s)))
+ (let ((n (swiper--line-number s)))
(setq s (substring s 1))
(add-text-properties 0 1 (list 'swiper-line-number
n) s)
(cons n s)))
@@ -819,7 +819,7 @@ When non-nil, INITIAL-INPUT is the initial search pattern."
(if initial-input
(cl-position-if
(lambda (x)
- (= (1+ preselect) (get-text-property 0
'swiper-line-number x)))
+ (= (1+ preselect) (swiper--line-number x)))
(progn
(setq ivy--old-re nil)
(ivy--filter initial-input candidates)))
@@ -955,7 +955,7 @@ the face, window and priority of the overlay."
(let* ((re (replace-regexp-in-string
" " "\t"
re))
- (num (get-text-property 0 'swiper-line-number
(ivy-state-current ivy-last))))
+ (num (swiper--line-number (ivy-state-current ivy-last))))
(unless (memq this-command '(ivy-yank-word
ivy-yank-symbol
ivy-yank-char
@@ -1093,9 +1093,13 @@ WND, when specified is the window."
(recenter))))
(setq swiper--current-window-start (window-start)))
+(defun swiper--line-number (x)
+ (or (get-text-property 0 'swiper-line-number x)
+ (get-text-property 1 'swiper-line-number x)))
+
(defun swiper--action (x)
"Goto line X."
- (let ((ln (1- (get-text-property 0 'swiper-line-number x)))
+ (let ((ln (1- (swiper--line-number x)))
(re (ivy--regex ivy-text))
(case-fold-search (ivy--case-fold-p ivy-text)))
(if (null x)
@@ -1212,7 +1216,7 @@ otherwise continue prompting for buffers."
(with-ivy-window
(switch-to-buffer buffer-name)
(goto-char (point-min))
- (forward-line (1- (get-text-property 0 'swiper-line-number x)))
+ (forward-line (1- (swiper--line-number x)))
(re-search-forward
(ivy--regex ivy-text)
(line-end-position) t)
- [elpa] externals/ivy-hydra 4d497e2 132/395: Add support for adding additional multi-actions, (continued)
- [elpa] externals/ivy-hydra 4d497e2 132/395: Add support for adding additional multi-actions, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 27b2ae5 141/395: Don't hardcode C-s and C-r, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 6a902b5 145/395: counsel.el (string-trim-left): Add declare-function, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 98a29b6 148/395: Fix C-<backspace> not working in counsel-file-jump, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 19bc4ed 149/395: ivy.el (ivy-ignore-buffers): Ignore *tramp/ buffers, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 982a5ac 150/395: ivy.el (ivy--tramp-candidates): The initial directory on remote should be "/", Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 554c178 158/395: ivy.el (ivy-set-actions): Allow to override the default action using "o", Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 0cff3e1 157/395: swiper.el (swiper): Add isearch-clean-overlays, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 35d015b 166/395: ivy.el (ivy-avy): Configure no-counsel-M-x, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 18d7ff9 168/395: ivy.el (ivy--set-candidates): Delete duplicates, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra b9eb3c1 162/395: swiper.el (swiper--line-number): Works with ivy-mark,
Basil L. Contovounesios <=
- [elpa] externals/ivy-hydra ba73e45 156/395: ivy.el (ivy-read-action): Avoid ivy-read-action-ivy overwriting ivy--directory, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 328da1f 170/395: counsel.el (counsel-rg): Split command args in a more familiar way, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 1c1573e 167/395: ivy.el (ivy--update-prompt): Handle auto-insert.el, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 45a3609 176/395: counsel.el (counsel-rg-base-command): Add "-M 120" by default, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 0258725 175/395: counsel.el: Fix candidate splitting when eol is CR or CRLF, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 8fae568 184/395: counsel.el (counsel-org-link): Add, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 9b36d9c 186/395: swiper.el (swiper-isearch): Use ivy-init-fns-alist, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 9e1513f 195/395: ivy.el (ivy--split): Don't split consecutive group brackets, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 7b9b3cc 200/395: ivy.el (ivy--switch-buffer-matcher): Complete remote dirs via ":", Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 829cf8a 212/395: ivy.el (ivy--done): Set ivy-text, Basil L. Contovounesios, 2021/02/25